From b3f3a1ccc11014a5337b956fa17b6bafb0c81f19 Mon Sep 17 00:00:00 2001 From: Cheng Jian Date: Mon, 28 Jan 2019 10:09:16 +0800 Subject: [PATCH] livepatch/arm64: use for_each_process_thread instead instead of while_each_thread euler inclusion category: bugfix Bugzilla: 5507 CVE: N/A ---------------------------------------- The commit 0c740d0afc3b ("introduce for_each_thread() to replace the buggy while_each_thread()") replace while_each_thread. while_each_thread() and next_thread() should die, almost every lockless. So use for_each_process_thread which is more safer than others to check the livepatch activeness function when enable. Signed-off-by: Cheng Jian Reviewed-by: Li Bin Signed-off-by: Yang Yingliang --- arch/arm64/kernel/livepatch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/kernel/livepatch.c b/arch/arm64/kernel/livepatch.c index ead6a34bb523..460e8585f5c0 100644 --- a/arch/arm64/kernel/livepatch.c +++ b/arch/arm64/kernel/livepatch.c @@ -109,7 +109,7 @@ int klp_check_calltrace(struct klp_patch *patch, int enable) .ret = 0 }; - do_each_thread(g, t) { + for_each_process_thread(g, t) { frame.fp = thread_saved_fp(t); frame.pc = thread_saved_pc(t); #ifdef CONFIG_FUNCTION_GRAPH_TRACER @@ -122,7 +122,7 @@ int klp_check_calltrace(struct klp_patch *patch, int enable) show_stack(t, NULL); goto out; } - } while_each_thread(g, t); + } out: return ret; -- GitLab