Skip to content

Commit 1723be3

Browse files
committed
x86/entry: Mark enter_from_user_mode() noinstr
Both the callers in the low level ASM code and __context_tracking_exit() which is invoked from enter_from_user_mode() via user_exit_irqoff() are marked NOKPROBE. Allowing enter_from_user_mode() to be probed is inconsistent at best. Aside of that while function tracing per se is safe the function trace entry/exit points can be used via BPF as well which is not safe to use before context tracking has reached CONTEXT_KERNEL and adjusted RCU. Mark it noinstr which moves it into the instrumentation protected text section and includes notrace. Note, this needs further fixups in context tracking to ensure that the full call chain is protected. Will be addressed in follow up changes. Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Masami Hiramatsu <[email protected]> Reviewed-by: Alexandre Chartre <[email protected]> Acked-by: Peter Zijlstra <[email protected]> Link: https://lkml.kernel.org/r/[email protected]
1 parent 8c0fa8a commit 1723be3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/entry/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
#ifdef CONFIG_CONTEXT_TRACKING
4343
/* Called on entry from user mode with IRQs off. */
44-
__visible inline void enter_from_user_mode(void)
44+
__visible inline noinstr void enter_from_user_mode(void)
4545
{
4646
CT_WARN_ON(ct_state() != CONTEXT_USER);
4747
user_exit_irqoff();

0 commit comments

Comments
 (0)