Skip to content

Commit

Permalink
sched: Fix KCSAN noinstr violation
Browse files Browse the repository at this point in the history
[ Upstream commit e0b081d ]

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
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
jpoimboe authored and gregkh committed May 24, 2023
1 parent 68f2811 commit d32c068
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/sched/task_stack.h
Expand Up @@ -23,7 +23,7 @@ static __always_inline void *task_stack_page(const struct task_struct *task)

#define setup_thread_stack(new,old) do { } while(0)

static inline unsigned long *end_of_stack(const struct task_struct *task)
static __always_inline unsigned long *end_of_stack(const struct task_struct *task)
{
#ifdef CONFIG_STACK_GROWSUP
return (unsigned long *)((unsigned long)task->stack + THREAD_SIZE) - 1;
Expand Down

0 comments on commit d32c068

Please sign in to comment.