dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@bugzilla.kernel.org
To: dri-devel@lists.freedesktop.org
Subject: [Bug 198221] nouveau DRM driver scheduling invalid work
Date: Thu, 21 Dec 2017 04:32:00 +0000	[thread overview]
Message-ID: <bug-198221-2300-8SDN3fYXYu@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-198221-2300@https.bugzilla.kernel.org/>

https://bugzilla.kernel.org/show_bug.cgi?id=198221

Petr Vandrovec (petr@vandrovec.name) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Regression|No                          |Yes

--- Comment #2 from Petr Vandrovec (petr@vandrovec.name) ---
I've built kernel with the change and give it some time, but I don't think that
it is a culprit.

I think that there is a race in how nouveau handles scheduled work:

This work being scheduled has func callback set to
nouveau_gem_object_delete_work(), which does its job, and then frees the work.

Now nouveau_cli_work_queue sets some work properties, adds work to the
cli->worker queue, and schedules work->cli->work.

But nouveau_cli_work might run between the moment work is added to cli->worker
queue and moment schedule_work(&work->cli->work) is issued.

In that case work dereference in nouveau_cli_work_fence will access freed work
memory, read garbage (0x00010000 in this case), add offsetof(cli, work) of
0x1f8, and pass this garbage pointer into schedule_work().

I'm not entirely sure what are expectations for the work, but perhaps work
should be added to the cli->worker list from nouveau_cli_work_fence, rather
than by nouveau_cli_work_queue. 

Regression seems to be introduced by 814a23243bd2aaa9aafe03d85d0502a73be42b58,
"drm/nouveau: implement per-client delayed workqueue with fence support"

-- 
You are receiving this mail because:
You are watching the assignee of the bug.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2017-12-21  4:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-21  0:59 [Bug 198221] New: nouveau DRM driver scheduling invalid work bugzilla-daemon
2017-12-21  1:21 ` [Bug 198221] " bugzilla-daemon
2017-12-21  4:32 ` bugzilla-daemon [this message]
2017-12-21  7:17 ` bugzilla-daemon
2017-12-29 21:08 ` bugzilla-daemon
2017-12-29 21:45 ` bugzilla-daemon

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=bug-198221-2300-8SDN3fYXYu@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@bugzilla.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    /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