lkml.org 
[lkml]   [2019]   [Sep]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2019-09-04 11:14    [W:0.050 / U:1.840 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site