提交 da6731e7 编写于 作者: X Xiongfeng Wang 提交者: Zheng Zengkai

stop_machine: mask sdei before running the callback

hulk inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4JBQ8

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

Kprobes use 'stop_machine' to modify code which could be ran in the
sdei_handler at the same time. This patch mask sdei before running the
stop_machine callback to avoid this race condition.
Signed-off-by: NXiongfeng Wang <wangxiongfeng2@huawei.com>
Reviewed-by: NYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: NWei Li <liwei391@huawei.com>
Reviewed-by: NCheng Jian <cj.chengjian@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 02693e3f
......@@ -23,6 +23,10 @@
#include <linux/nmi.h>
#include <linux/sched/wake_q.h>
#ifdef CONFIG_ARM64
#include <linux/arm_sdei.h>
#endif
/*
* Structure to determine completion condition and record errors. May
* be shared by works on different cpus.
......@@ -218,6 +222,9 @@ static int multi_cpu_stop(void *data)
case MULTI_STOP_DISABLE_IRQ:
local_irq_disable();
hard_irq_disable();
#ifdef CONFIG_ARM64
sdei_mask_local_cpu();
#endif
break;
case MULTI_STOP_RUN:
if (is_active)
......@@ -238,6 +245,9 @@ static int multi_cpu_stop(void *data)
rcu_momentary_dyntick_idle();
} while (curstate != MULTI_STOP_EXIT);
#ifdef CONFIG_ARM64
sdei_unmask_local_cpu();
#endif
local_irq_restore(flags);
return err;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册