提交 6c19c0e5 编写于 作者: X Xiongfeng Wang 提交者: Xie XiuQi

kprobes/arm64: Blacklist sdei watchdog callback functions

euler inclusion
category: bugfix
Bugzilla: 5515
CVE: N/A

----------------------------------------

Functions called in sdei_handler are not allowed to be kprobed, so
marked them as NOKPROBE_SYMBOL. There are so many functions in
'watchdog_check_timestamp()'. Luckily, we don't need
'CONFIG_HARDLOCKUP_CHECK_TIMESTAMP' now. So just make
CONFIG_SDEI_WATCHDOG depends on !CONFIG_HARDLOCKUP_CHECK_TIMESTAMP
in case someone add 'CONFIG_HARDLOCKUP_CHECK_TIMESTAMP' in the future.
Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 443c46f3
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <asm/sdei.h> #include <asm/sdei.h>
#include <asm/virt.h> #include <asm/virt.h>
#include <linux/arm_sdei.h> #include <linux/arm_sdei.h>
#include <linux/kprobes.h>
#include <linux/nmi.h> #include <linux/nmi.h>
/* We use the secure physical timer as SDEI NMI watchdog timer */ /* We use the secure physical timer as SDEI NMI watchdog timer */
...@@ -66,6 +67,7 @@ static int sdei_watchdog_callback(u32 event, ...@@ -66,6 +67,7 @@ static int sdei_watchdog_callback(u32 event,
return 0; return 0;
} }
NOKPROBE_SYMBOL(sdei_watchdog_callback);
static void sdei_nmi_watchdog_bind(void *data) static void sdei_nmi_watchdog_bind(void *data)
{ {
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/cpu.h> #include <linux/cpu.h>
#include <linux/nmi.h> #include <linux/nmi.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/kprobes.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/sysctl.h> #include <linux/sysctl.h>
#include <linux/tick.h> #include <linux/tick.h>
...@@ -324,6 +325,7 @@ bool is_hardlockup(void) ...@@ -324,6 +325,7 @@ bool is_hardlockup(void)
__this_cpu_write(hrtimer_interrupts_saved, hrint); __this_cpu_write(hrtimer_interrupts_saved, hrint);
return false; return false;
} }
NOKPROBE_SYMBOL(is_hardlockup);
static void watchdog_interrupt_count(void) static void watchdog_interrupt_count(void)
{ {
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/nmi.h> #include <linux/nmi.h>
#include <linux/atomic.h> #include <linux/atomic.h>
#include <linux/kprobes.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/sched/debug.h> #include <linux/sched/debug.h>
...@@ -152,6 +153,7 @@ void watchdog_hardlockup_check(struct pt_regs *regs) ...@@ -152,6 +153,7 @@ void watchdog_hardlockup_check(struct pt_regs *regs)
__this_cpu_write(hard_watchdog_warn, false); __this_cpu_write(hard_watchdog_warn, false);
return; return;
} }
NOKPROBE_SYMBOL(watchdog_hardlockup_check);
#ifdef CONFIG_HARDLOCKUP_DETECTOR_PERF #ifdef CONFIG_HARDLOCKUP_DETECTOR_PERF
static DEFINE_PER_CPU(struct perf_event *, watchdog_ev); static DEFINE_PER_CPU(struct perf_event *, watchdog_ev);
......
...@@ -843,7 +843,7 @@ choice ...@@ -843,7 +843,7 @@ choice
config SDEI_WATCHDOG config SDEI_WATCHDOG
bool "SDEI NMI Watchdog support" bool "SDEI NMI Watchdog support"
depends on ARM_SDE_INTERFACE depends on ARM_SDE_INTERFACE && !HARDLOCKUP_CHECK_TIMESTAMP
select HAVE_HARDLOCKUP_DETECTOR_ARCH select HAVE_HARDLOCKUP_DETECTOR_ARCH
config PMU_WATCHDOG config PMU_WATCHDOG
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册