From: Zheng Yejian zhengyejian1@huawei.com
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I60L10 CVE: NA
--------------------------------
In arm/arm64/ppc32/ppc64, this field is named as old_insns, so uniform it.
Signed-off-by: Zheng Yejian zhengyejian1@huawei.com Reviewed-by: Kuohai Xu xukuohai@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- arch/x86/include/asm/livepatch.h | 2 +- arch/x86/kernel/livepatch.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/livepatch.h b/arch/x86/include/asm/livepatch.h index b510f935ec11..dbcf69b9c4cb 100644 --- a/arch/x86/include/asm/livepatch.h +++ b/arch/x86/include/asm/livepatch.h @@ -36,7 +36,7 @@ int klp_check_calltrace(struct klp_patch *patch, int enable);
#define JMP_E9_INSN_SIZE 5 struct arch_klp_data { - unsigned char old_code[JMP_E9_INSN_SIZE]; + unsigned char old_insns[JMP_E9_INSN_SIZE]; #ifdef CONFIG_LIVEPATCH_STOP_MACHINE_CONSISTENCY /* * Saved opcode at the entry of the old func (which maybe replaced diff --git a/arch/x86/kernel/livepatch.c b/arch/x86/kernel/livepatch.c index d134169488b6..5488bf014637 100644 --- a/arch/x86/kernel/livepatch.c +++ b/arch/x86/kernel/livepatch.c @@ -483,7 +483,7 @@ long arch_klp_save_old_code(struct arch_klp_data *arch_data, void *old_func)
/* Prevent text modification */ mutex_lock(&text_mutex); - ret = copy_from_kernel_nofault(arch_data->old_code, + ret = copy_from_kernel_nofault(arch_data->old_insns, old_func, JMP_E9_INSN_SIZE); mutex_unlock(&text_mutex);
@@ -525,7 +525,7 @@ void arch_klp_unpatch_func(struct klp_func *func) ip = (unsigned long)func_node->old_func; list_del_rcu(&func->stack_node); if (list_empty(&func_node->func_stack)) { - new = func_node->arch_data.old_code; + new = func_node->arch_data.old_insns; } else { next_func = list_first_or_null_rcu(&func_node->func_stack, struct klp_func, stack_node);