aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/event_analyzing_sample.py
diff options
context:
space:
mode:
authorChris Wilson <[email protected]>2015-11-25 14:39:02 +0000
committerDaniel Vetter <[email protected]>2015-11-26 15:21:06 +0100
commit83eb64c85b80959549c114365016276f318afeb2 (patch)
tree61115345021697f6b6dad4121cf0171b07b3f833 /tools/perf/scripts/python/event_analyzing_sample.py
parent87069f4493b2101a71a92b7b9565f488a605a88f (diff)
drm: Drop dev->event_lock spinlock around faulting copy_to_user()
In commit cdd1cf799bd24ac0a4184549601ae302267301c5 Author: Chris Wilson <[email protected]> Date: Thu Dec 4 21:03:25 2014 +0000 drm: Make drm_read() more robust against multithreaded races I fixed the races by serialising the use of the event by extending the dev->event_lock. However, as Thomas pointed out, the copy_to_user() may fault (even the __copy_to_user_inatomic() variant used here) and calling into the driver backend with the spinlock held is bad news. Therefore we have to drop the spinlock before the copy, but that exposes us to the old race whereby a second reader could see an out-of-order event (as the first reader may claim the first request but fail to copy it back to userspace and so on returning it to the event list it will be behind the current event being copied by the second reader). Reported-by: Thomas Hellstrom <[email protected]> Signed-off-by: Chris Wilson <[email protected]> Cc: Thomas Hellstrom <[email protected]> Cc: Takashi Iwai <[email protected]> Cc: Daniel Vetter <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Thomas Hellstrom <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/event_analyzing_sample.py')
0 files changed, 0 insertions, 0 deletions