kernel/signal.c: fix kernel information leak with print-fatal-signals=1
commit87506bf2614e12d1cc4882613af0cb972aaa319a
authorAndi Kleen <andi@firstfloor.org>
Fri, 8 Jan 2010 22:42:52 +0000 (8 14:42 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 18 Jan 2010 18:28:47 +0000 (18 10:28 -0800)
tree7df59de8d03fcbe1dfd00fdb1a05e3b8d8eb4639
parentfb99d026f4d9392ff9979beb26b5800188a56891
kernel/signal.c: fix kernel information leak with print-fatal-signals=1

commit b45c6e76bc2c72f6426c14bed64fdcbc9bf37cb0 upstream.

When print-fatal-signals is enabled it's possible to dump any memory
reachable by the kernel to the log by simply jumping to that address from
user space.

Or crash the system if there's some hardware with read side effects.

The fatal signals handler will dump 16 bytes at the execution address,
which is fully controlled by ring 3.

In addition when something jumps to a unmapped address there will be up to
16 additional useless page faults, which might be potentially slow (and at
least is not very efficient)

Fortunately this option is off by default and only there on i386.

But fix it by checking for kernel addresses and also stopping when there's
a page fault.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/signal.c