From: Ye Weihua yeweihua4@huawei.com
hulk inclusion category: bugfix bugzilla: 185757 https://gitee.com/openeuler/kernel/issues/I4DDEL
---------------------------
During the test, it is found that the running function to be patched is not detected when enabling the livepatch. It will cause unkown problems.
The cause is that the return value of the klp_check_jump_func() is incorrect. To solve the problem, reverse the return value.
Signed-off-by: Ye Weihua yeweihua4@huawei.com Reviewed-by: Kuohai Xu xukuohai@huawei.com
Signed-off-by: Chen Jun chenjun102@huawei.com --- arch/arm/kernel/livepatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/kernel/livepatch.c b/arch/arm/kernel/livepatch.c index e98c8e47a344..221275714899 100644 --- a/arch/arm/kernel/livepatch.c +++ b/arch/arm/kernel/livepatch.c @@ -278,11 +278,11 @@ static bool check_func_list(struct klp_func_list *funcs, int *ret, unsigned long *ret = klp_compare_address(pc, funcs->func_addr, funcs->func_name, klp_size_to_check(funcs->func_size, funcs->force)); if (*ret) { - return false; + return true; } funcs = funcs->next; } - return true; + return false; }
static int klp_check_jump_func(struct stackframe *frame, void *data)