Messages in this thread | | | Date | Wed, 04 Sep 2019 14:43:26 +0530 | From | "Naveen N. Rao" <> | Subject | Re: [PATCH -tip v2] kprobes: Prohibit probing on BUG() and WARN() address |
| |
Masami Hiramatsu wrote: > Since BUG() and WARN() may use a trap (e.g. UD2 on x86) to > get the address where the BUG() has occurred, kprobes can not > do single-step out-of-line that instruction. So prohibit > probing on such address. > > Without this fix, if someone put a kprobe on WARN(), the > kernel will crash with invalid opcode error instead of > outputing warning message, because kernel can not find > correct bug address. > > Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> > --- > Changes in v2: > - Add find_bug() stub function for !CONFIG_GENERIC_BUG > - Cast the p->addr to unsigned long. > --- > include/linux/bug.h | 5 +++++ > kernel/kprobes.c | 3 ++- > 2 files changed, 7 insertions(+), 1 deletion(-)
Acked-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
- Naveen
| |