arm64: Blacklist non-kprobe-able symbol
Add all function symbols which are called from do_debug_exception under NOKPROBE_SYMBOL, as they can not kprobed. Signed-off-by: Pratyush Anand <panand@redhat.com> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
This commit is contained in:

committed by
Catalin Marinas

parent
2dd0e8d2d2
commit
44b53f67c9
@@ -24,6 +24,7 @@
|
||||
#include <linux/cpu_pm.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/hw_breakpoint.h>
|
||||
#include <linux/kprobes.h>
|
||||
#include <linux/perf_event.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <linux/smp.h>
|
||||
@@ -127,6 +128,7 @@ static u64 read_wb_reg(int reg, int n)
|
||||
|
||||
return val;
|
||||
}
|
||||
NOKPROBE_SYMBOL(read_wb_reg);
|
||||
|
||||
static void write_wb_reg(int reg, int n, u64 val)
|
||||
{
|
||||
@@ -140,6 +142,7 @@ static void write_wb_reg(int reg, int n, u64 val)
|
||||
}
|
||||
isb();
|
||||
}
|
||||
NOKPROBE_SYMBOL(write_wb_reg);
|
||||
|
||||
/*
|
||||
* Convert a breakpoint privilege level to the corresponding exception
|
||||
@@ -157,6 +160,7 @@ static enum dbg_active_el debug_exception_level(int privilege)
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
NOKPROBE_SYMBOL(debug_exception_level);
|
||||
|
||||
enum hw_breakpoint_ops {
|
||||
HW_BREAKPOINT_INSTALL,
|
||||
@@ -575,6 +579,7 @@ static void toggle_bp_registers(int reg, enum dbg_active_el el, int enable)
|
||||
write_wb_reg(reg, i, ctrl);
|
||||
}
|
||||
}
|
||||
NOKPROBE_SYMBOL(toggle_bp_registers);
|
||||
|
||||
/*
|
||||
* Debug exception handlers.
|
||||
@@ -654,6 +659,7 @@ unlock:
|
||||
|
||||
return 0;
|
||||
}
|
||||
NOKPROBE_SYMBOL(breakpoint_handler);
|
||||
|
||||
static int watchpoint_handler(unsigned long addr, unsigned int esr,
|
||||
struct pt_regs *regs)
|
||||
@@ -756,6 +762,7 @@ unlock:
|
||||
|
||||
return 0;
|
||||
}
|
||||
NOKPROBE_SYMBOL(watchpoint_handler);
|
||||
|
||||
/*
|
||||
* Handle single-step exception.
|
||||
@@ -813,6 +820,7 @@ int reinstall_suspended_bps(struct pt_regs *regs)
|
||||
|
||||
return !handled_exception;
|
||||
}
|
||||
NOKPROBE_SYMBOL(reinstall_suspended_bps);
|
||||
|
||||
/*
|
||||
* Context-switcher for restoring suspended breakpoints.
|
||||
|
Reference in New Issue
Block a user