Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tracing: Fix null pointer deref with SEND_SIG_FORCED

BUG: unable to handle kernel NULL pointer dereference at
0000000000000006
IP: [<ffffffff8107bd37>] ftrace_raw_event_signal_generate+0x87/0x140

TP_STORE_SIGINFO() forgets about SEND_SIG_FORCED, fix.

We should probably export is_si_special() and change TP_STORE_SIGINFO()
to use it in the longer term.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Roland McGrath <roland@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jason Baron <jbaron@redhat.com>
Cc: Masami Hiramatsu <mhiramat@redhat.com>
Cc: 2.6.33.x-2.6.34.x <stable@kernel.org>
LKML-Reference: <20100603213409.GA8307@redhat.com>
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>

authored by

Oleg Nesterov and committed by
Frederic Weisbecker
b9b76dfa 58cc1a9e

+2 -1
+2 -1
include/trace/events/signal.h
··· 10 10 11 11 #define TP_STORE_SIGINFO(__entry, info) \ 12 12 do { \ 13 - if (info == SEND_SIG_NOINFO) { \ 13 + if (info == SEND_SIG_NOINFO || \ 14 + info == SEND_SIG_FORCED) { \ 14 15 __entry->errno = 0; \ 15 16 __entry->code = SI_USER; \ 16 17 } else if (info == SEND_SIG_PRIV) { \