diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2025-01-08 10:04:51 +0100 |
---|---|---|
committer | Petr Pavlu <petr.pavlu@suse.com> | 2025-03-10 11:54:45 +0100 |
commit | 14daa3bca2176024704ceac1b476712309352261 (patch) | |
tree | a312e5c2bb18e3e728fc46ee0e0b089b46bae606 /arch/x86/kernel/unwind_orc.c | |
parent | e151955bacf881e1f918613558e04f2f976169e4 (diff) |
x86: Use RCU in all users of __module_address().
__module_address() can be invoked within a RCU section, there is no
requirement to have preemption disabled.
Replace the preempt_disable() section around __module_address() with
RCU.
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: x86@kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250108090457.512198-23-bigeasy@linutronix.de
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Diffstat (limited to 'arch/x86/kernel/unwind_orc.c')
-rw-r--r-- | arch/x86/kernel/unwind_orc.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c index d4705a348a804..977ee75e047c8 100644 --- a/arch/x86/kernel/unwind_orc.c +++ b/arch/x86/kernel/unwind_orc.c @@ -476,7 +476,7 @@ bool unwind_next_frame(struct unwind_state *state) return false; /* Don't let modules unload while we're reading their ORC data. */ - preempt_disable(); + guard(rcu)(); /* End-of-stack check for user tasks: */ if (state->regs && user_mode(state->regs)) @@ -669,14 +669,12 @@ bool unwind_next_frame(struct unwind_state *state) goto err; } - preempt_enable(); return true; err: state->error = true; the_end: - preempt_enable(); state->stack_info.type = STACK_TYPE_UNKNOWN; return false; } |