From fab940755d1d78377901450b6ee7c77356e06821 Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Sun, 27 Jan 2019 14:03:57 +0100 Subject: x86/hw_breakpoints, kprobes: Remove kprobes ifdeffery Remove the ifdeffery in the breakpoint parsing arch_build_bp_info() by adding a within_kprobe_blacklist() stub for the !CONFIG_KPROBES case. It is returning true when kprobes are not enabled to mean that any address is within the kprobes blacklist on such kernels and thus not allow kernel breakpoints on non-kprobes kernels. Signed-off-by: Borislav Petkov Acked-by: Masami Hiramatsu Cc: Anil S Keshavamurthy Cc: "David S. Miller" Cc: Frederic Weisbecker Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: "Naveen N. Rao" Cc: Thomas Gleixner Link: https://lkml.kernel.org/r/20190127131237.4557-1-bp@alien8.de --- arch/x86/kernel/hw_breakpoint.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'arch/x86/kernel/hw_breakpoint.c') diff --git a/arch/x86/kernel/hw_breakpoint.c b/arch/x86/kernel/hw_breakpoint.c index 7d6f91f2869a..ff9bfd40429e 100644 --- a/arch/x86/kernel/hw_breakpoint.c +++ b/arch/x86/kernel/hw_breakpoint.c @@ -261,12 +261,8 @@ static int arch_build_bp_info(struct perf_event *bp, * allow kernel breakpoints at all. */ if (attr->bp_addr >= TASK_SIZE_MAX) { -#ifdef CONFIG_KPROBES if (within_kprobe_blacklist(attr->bp_addr)) return -EINVAL; -#else - return -EINVAL; -#endif } hw->type = X86_BREAKPOINT_EXECUTE; -- cgit v1.2.3