]> git.baikalelectronics.ru Git - kernel.git/commit
x86/entry: Mark enter_from_user_mode() noinstr
authorThomas Gleixner <tglx@linutronix.de>
Sat, 29 Feb 2020 14:12:33 +0000 (15:12 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 11 Jun 2020 13:14:38 +0000 (15:14 +0200)
commit3cfec51585ea7988ca8028439e0af4e0f42edea7
treeb5ea052edf2f0894e63d283cba84625bd51bb809
parent7affd140feb47f237148cc1a3d606b9b128ab588
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 <tglx@linutronix.de>
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
Reviewed-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20200505134340.429059405@linutronix.de
arch/x86/entry/common.c