hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I8ORHJ
--------------------------------
Replacing is an optimization for livepatching based on ftrace, the wo_ftrace solution do not support it.
Signed-off-by: Zheng Yejian zhengyejian1@huawei.com --- kernel/livepatch/core.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c index 40259a2988e9..cc7e140088df 100644 --- a/kernel/livepatch/core.c +++ b/kernel/livepatch/core.c @@ -1155,6 +1155,9 @@ static void klp_init_func_early(struct klp_object *obj, kobject_init(&func->kobj, &klp_ktype_func); list_add_tail(&func->node, &obj->func_list); func->func_node = NULL; +#ifdef CONFIG_LIVEPATCH_STOP_MACHINE_CONSISTENCY + func->nop = false; +#endif }
static void klp_init_object_early(struct klp_patch *patch, @@ -1165,6 +1168,7 @@ static void klp_init_object_early(struct klp_patch *patch, list_add_tail(&obj->node, &patch->obj_list); #ifdef CONFIG_LIVEPATCH_STOP_MACHINE_CONSISTENCY obj->mod = NULL; + obj->dynamic = false; #endif }
@@ -1199,6 +1203,12 @@ static int klp_init_patch(struct klp_patch *patch) if (ret) return ret;
+#ifdef CONFIG_LIVEPATCH_STOP_MACHINE_CONSISTENCY + if (patch->replace) { + pr_err("Replacing is not supported\n"); + return -EINVAL; + } +#endif if (patch->replace) { ret = klp_add_nops(patch); if (ret)
反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/3924 邮件列表地址:https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/I...
FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/3924 Mailing list address: https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/I...