]> git.baikalelectronics.ru Git - kernel.git/commit
tracing: Prevent kernel oops with corrupted buffer
authorSteven Rostedt <srostedt@redhat.com>
Mon, 25 Jan 2010 20:11:53 +0000 (15:11 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Mon, 25 Jan 2010 20:11:53 +0000 (15:11 -0500)
commit530a2cdec68bd09fc4acb859f51b0424b1fb41c9
treed992d49f992cd77e20c9833876c021ad9b265f57
parentdd7785231b451ef779f52e8610f028da53b51088
tracing: Prevent kernel oops with corrupted buffer

If the contents of the ftrace ring buffer gets corrupted and the trace
file is read, it could create a kernel oops (usualy just killing the user
task thread). This is caused by the checking of the pid in the buffer.
If the pid is negative, it still references the cmdline cache array,
which could point to an invalid address.

The simple fix is to test for negative PIDs.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace.c