Commit 4bda5ebf authored by Zheng Yejian's avatar Zheng Yejian
Browse files

livepatch/core: Disable support for replacing

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


CVE: NA

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

Replacing is an optimization for livepatching based on ftrace, the
wo_ftrace solution do not support it.

Signed-off-by: default avatarZheng Yejian <zhengyejian1@huawei.com>
parent 583e6e55
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -170,7 +170,7 @@ struct klp_patch {
	struct module *mod;
	struct klp_object *objs;
	struct klp_state *states; /* Not used in the solution without ftrace */
	bool replace; /* Not used in the solution without ftrace */
	bool replace; /* Not supported in the solution without ftrace */

	/* internal */
	struct list_head list;
+5 −2
Original line number Diff line number Diff line
@@ -1037,13 +1037,16 @@ static int klp_init_patch(struct klp_patch *patch)
	if (ret)
		return ret;

#ifdef CONFIG_LIVEPATCH_FTRACE
	if (patch->replace) {
#ifdef CONFIG_LIVEPATCH_FTRACE
		ret = klp_add_nops(patch);
		if (ret)
			return ret;
	}
#else
		pr_err("Replacing is not supported\n");
		return -EINVAL;
#endif
	}

	klp_for_each_object(patch, obj) {
		ret = klp_init_object(patch, obj);