* [PATCH v2 01/28] module: Extend the preempt disabled section in dereference_symbol_descriptor().
[not found] <20241220174731.514432-1-bigeasy@linutronix.de>
@ 2024-12-20 17:41 ` Sebastian Andrzej Siewior
2025-01-07 10:58 ` Sergey Senozhatsky
0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Andrzej Siewior @ 2024-12-20 17:41 UTC (permalink / raw)
To: linux-modules, linux-kernel
Cc: Daniel Gomez, Luis Chamberlain, Paul E . McKenney, Peter Zijlstra,
Petr Pavlu, Sami Tolvanen, Thomas Gleixner,
Sebastian Andrzej Siewior, James E.J. Bottomley, Christophe Leroy,
Helge Deller, Madhavan Srinivasan, Michael Ellerman, Naveen N Rao,
Nicholas Piggin, Sergey Senozhatsky, linux-parisc, linuxppc-dev
dereference_symbol_descriptor() needs to obtain the module pointer
belonging to pointer in order to resolve that pointer.
The returned mod pointer is obtained under RCU-sched/ preempt_disable()
guarantees and needs to be used within this section to ensure that the
module is not removed in the meantime.
Extend the preempt_disable() section to also cover
dereference_module_function_descriptor().
Fixes: 04b8eb7a4ccd9 ("symbol lookup: introduce dereference_symbol_descriptor()")
Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Helge Deller <deller@gmx.de>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Naveen N Rao <naveen@kernel.org>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: linux-parisc@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
include/linux/kallsyms.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index c3f075e8f60cb..1c6a6c1704d8d 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -57,10 +57,10 @@ static inline void *dereference_symbol_descriptor(void *ptr)
preempt_disable();
mod = __module_address((unsigned long)ptr);
- preempt_enable();
if (mod)
ptr = dereference_module_function_descriptor(mod, ptr);
+ preempt_enable();
#endif
return ptr;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 01/28] module: Extend the preempt disabled section in dereference_symbol_descriptor().
2024-12-20 17:41 ` [PATCH v2 01/28] module: Extend the preempt disabled section in dereference_symbol_descriptor() Sebastian Andrzej Siewior
@ 2025-01-07 10:58 ` Sergey Senozhatsky
0 siblings, 0 replies; 2+ messages in thread
From: Sergey Senozhatsky @ 2025-01-07 10:58 UTC (permalink / raw)
To: Sebastian Andrzej Siewior
Cc: linux-modules, linux-kernel, Daniel Gomez, Luis Chamberlain,
Paul E . McKenney, Peter Zijlstra, Petr Pavlu, Sami Tolvanen,
Thomas Gleixner, James E.J. Bottomley, Christophe Leroy,
Helge Deller, Madhavan Srinivasan, Michael Ellerman, Naveen N Rao,
Nicholas Piggin, Sergey Senozhatsky, linux-parisc, linuxppc-dev
On (24/12/20 18:41), Sebastian Andrzej Siewior wrote:
> dereference_symbol_descriptor() needs to obtain the module pointer
> belonging to pointer in order to resolve that pointer.
> The returned mod pointer is obtained under RCU-sched/ preempt_disable()
> guarantees and needs to be used within this section to ensure that the
> module is not removed in the meantime.
>
> Extend the preempt_disable() section to also cover
> dereference_module_function_descriptor().
>
> Fixes: 04b8eb7a4ccd9 ("symbol lookup: introduce dereference_symbol_descriptor()")
> Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
> Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
> Cc: Helge Deller <deller@gmx.de>
> Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Naveen N Rao <naveen@kernel.org>
> Cc: Nicholas Piggin <npiggin@gmail.com>
> Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
> Cc: linux-parisc@vger.kernel.org
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
FWIW
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-07 10:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20241220174731.514432-1-bigeasy@linutronix.de>
2024-12-20 17:41 ` [PATCH v2 01/28] module: Extend the preempt disabled section in dereference_symbol_descriptor() Sebastian Andrzej Siewior
2025-01-07 10:58 ` Sergey Senozhatsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).