drm/i915: Do not dereference pointers from ring buffer in evict event
authorSteven Rostedt <rostedt@goodmis.org>
Tue, 18 Mar 2014 15:27:37 +0000 (11:27 -0400)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 19 Mar 2014 07:17:29 +0000 (08:17 +0100)
commit9297ebf29ad9118edd6c0fedc84f03e35028827d
tree4e798192157012279ae9839d3bdb0caae900c2de
parente5081a538a565284fec5f30a937d98e460d5e780
drm/i915: Do not dereference pointers from ring buffer in evict event

The TP_printk() should never dereference any pointers, because the ring
buffer can be read at some unknown time in the future. If a device no
longer exists, it can cause a kernel oops. This also makes this
event useless when saving the ring buffer in userspaces tools such as
perf and trace-cmd.

The i915_gem_evict_vm dereferences the vm pointer which may also not
exist when the ring buffer is read sometime in the future.

Link: http://lkml.kernel.org/r/1395095198-20034-3-git-send-email-artagnon@gmail.com
Reported-by: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: stable@vger.kernel.org # 3.13+
Fixes: bcccff847d1f "drm/i915: trace vm eviction instead of everything"
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
[danvet: Try to make it actually compile]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_trace.h