Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sched: Fix KCSAN noinstr violation

With KCSAN enabled, end_of_stack() can get out-of-lined. Force it
inline.

Fixes the following warnings:

vmlinux.o: warning: objtool: check_stackleak_irqoff+0x2b: call to end_of_stack() leaves .noinstr.text section

Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/cc1b4d73d3a428a00d206242a68fdf99a934ca7b.1681320026.git.jpoimboe@kernel.org

authored by

Josh Poimboeuf and committed by
Peter Zijlstra
e0b081d1 fb799447

+1 -1
+1 -1
include/linux/sched/task_stack.h
··· 23 23 24 24 #define setup_thread_stack(new,old) do { } while(0) 25 25 26 - static inline unsigned long *end_of_stack(const struct task_struct *task) 26 + static __always_inline unsigned long *end_of_stack(const struct task_struct *task) 27 27 { 28 28 #ifdef CONFIG_STACK_GROWSUP 29 29 return (unsigned long *)((unsigned long)task->stack + THREAD_SIZE) - 1;