]> git.baikalelectronics.ru Git - kernel.git/commit
kprobes/x86: Fix kernel panic when certain exception-handling addresses are probed
authorMasami Hiramatsu <mhiramat@kernel.org>
Tue, 28 Feb 2017 16:23:24 +0000 (01:23 +0900)
committerIngo Molnar <mingo@kernel.org>
Wed, 1 Mar 2017 08:56:13 +0000 (09:56 +0100)
commit635bedc93ffdcde46f6db09c4edbf677340f5863
treeb787566a2c4347d2e6ee04ad299393aa3a43282b
parentaf21e89b0ef97a736ce7e1e3966bd9599e6a97e2
kprobes/x86: Fix kernel panic when certain exception-handling addresses are probed

Fix to the exception table entry check by using probed address
instead of the address of copied instruction.

This bug may cause unexpected kernel panic if user probe an address
where an exception can happen which should be fixup by __ex_table
(e.g. copy_from_user.)

Unless user puts a kprobe on such address, this doesn't
cause any problem.

This bug has been introduced years ago, by commit:

  00b76a0eb995 ("x86/kprobes: Fix a bug which can modify kernel code permanently").

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: 00b76a0eb995 ("x86/kprobes: Fix a bug which can modify kernel code permanently")
Link: http://lkml.kernel.org/r/148829899399.28855.12581062400757221722.stgit@devbox
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/kprobes/common.h
arch/x86/kernel/kprobes/core.c
arch/x86/kernel/kprobes/opt.c