lkml.org 
[lkml]   [2023]   [Apr]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[tip: objtool/core] sched: Fix KCSAN noinstr violation
The following commit has been merged into the objtool/core branch of tip:

Commit-ID: e0b081d17a9f4e5c0cbb0e5fbeb1abe3de0f7e4e
Gitweb: https://git.kernel.org/tip/e0b081d17a9f4e5c0cbb0e5fbeb1abe3de0f7e4e
Author: Josh Poimboeuf <jpoimboe@kernel.org>
AuthorDate: Wed, 12 Apr 2023 10:24:07 -07:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 14 Apr 2023 16:08:26 +02:00

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
---
include/linux/sched/task_stack.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/sched/task_stack.h b/include/linux/sched/task_stack.h
index 5e799a4..f158b02 100644
--- a/include/linux/sched/task_stack.h
+++ b/include/linux/sched/task_stack.h
@@ -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;
\
 
 \ /
  Last update: 2023-04-14 16:49    [W:0.060 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site