提交 1daef7b0 编写于 作者: Y Yang Jihong 提交者: Zheng Zengkai

livepatch/powerpc32: Add arch_klp_module_check_calltrace

hulk inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I5CJ7X

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

Add arch_klp_module_check_calltrace to check whether stacks of all tasks
are within the code segment of module.
Signed-off-by: NYang Jihong <yangjihong1@huawei.com>
Reviewed-by: NXu Kuohai <xukuohai@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 60843384
......@@ -70,6 +70,7 @@ struct stackframe {
struct walk_stackframe_args {
int enable;
struct klp_func_list *check_funcs;
struct module *mod;
int ret;
};
......@@ -366,6 +367,28 @@ int klp_check_calltrace(struct klp_patch *patch, int enable)
free_list(&check_funcs);
return ret;
}
static int check_module_calltrace(struct stackframe *frame, void *data)
{
struct walk_stackframe_args *args = data;
if (within_module_core(frame->pc, args->mod)) {
pr_err("module %s is in use!\n", args->mod->name);
return (args->ret = -EBUSY);
}
return 0;
}
int arch_klp_module_check_calltrace(void *data)
{
struct walk_stackframe_args args = {
.mod = (struct module *)data,
.ret = 0
};
return do_check_calltrace(&args, check_module_calltrace);
}
#endif
#ifdef CONFIG_LIVEPATCH_WO_FTRACE
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册