mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vince Weaver <vincent.weaver@maine.edu>
To: Dave Hansen <dave.hansen@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>,
	Vince Weaver <vincent.weaver@maine.edu>,
	linux-kernel@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [perf] perf_fuzzer triggers NULL pointer derefernce in i915 driver
Date: Fri, 13 Dec 2019 14:53:48 -0500 (EST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1912131452170.19748@macbook-air> (raw)
In-Reply-To: <f2c6502a-f13e-a663-f1f5-c441964d77ac@intel.com>

On Fri, 13 Dec 2019, Dave Hansen wrote:

> On 12/12/19 11:09 PM, Jani Nikula wrote:
> > On Thu, 12 Dec 2019, Vince Weaver <vincent.weaver@maine.edu> wrote:
> >> with current git the perf_fuzzer was able to trigger this NULL pointer
> >> de-reference in the i915 driver.
> > Please file a bug.
> > 
> > https://gitlab.freedesktop.org/drm/intel/wikis/How-to-file-i915-bugs
> 
> I'm seeing the same thing.  It's annoyingly and immediately reproducible
> for me:
> 
> 	https://gitlab.freedesktop.org/drm/intel/issues/826
> 
> Let me know if you want anything fancier done like a bisect.  Looking
> back through my kernel logs, it appears to also have happened with
> 5.4.0-rc4.

This patch was sent out in response to my report (but not as a direct 
reply).


>From chris@chris-wilson.co.uk Thu Dec 12 10:42:36 2019
>Date: Thu, 12 Dec 2019 15:42:24 +0000
>From: Chris Wilson <chris@chris-wilson.co.uk>
>To: intel-gfx@lists.freedesktop.org
>Cc: Chris Wilson <chris@chris-wilson.co.uk>, Vince Weaver <vincent.weaver@maine.edu>, Matthew Auld <matthew.auld@intel.com>
>Subject: [PATCH] drm/i915: Set fence_work.ops before dma_fence_init

Since dma_fence_init may call ops (because of a meaningless
trace_dma_fence), we need to set the worker ops prior to that call.

Reported-by: Vince Weaver <vincent.weaver@maine.edu>
Fixes: 8e458fe2ee05 ("drm/i915: Generalise the clflush dma-worker")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Vince Weaver <vincent.weaver@maine.edu>
---
 drivers/gpu/drm/i915/i915_sw_fence_work.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_sw_fence_work.c b/drivers/gpu/drm/i915/i915_sw_fence_work.c
index 07552cd544f2..8538ee7a521d 100644
--- a/drivers/gpu/drm/i915/i915_sw_fence_work.c
+++ b/drivers/gpu/drm/i915/i915_sw_fence_work.c
@@ -78,12 +78,11 @@ static const struct dma_fence_ops fence_ops = {
 void dma_fence_work_init(struct dma_fence_work *f,
 			 const struct dma_fence_work_ops *ops)
 {
+	f->ops = ops;
 	spin_lock_init(&f->lock);
 	dma_fence_init(&f->dma, &fence_ops, &f->lock, 0, 0);
 	i915_sw_fence_init(&f->chain, fence_notify);
 	INIT_WORK(&f->work, fence_work);
-
-	f->ops = ops;
 }
 
 int dma_fence_work_chain(struct dma_fence_work *f, struct dma_fence *signal)
-- 
2.24.0


      reply	other threads:[~2019-12-13 20:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-12 15:36 Vince Weaver
2019-12-13  7:09 ` Jani Nikula
2019-12-13 19:20   ` Dave Hansen
2019-12-13 19:53     ` Vince Weaver [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.21.1912131452170.19748@macbook-air \
    --to=vincent.weaver@maine.edu \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=dave.hansen@intel.com \
    --cc=jani.nikula@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®