Skip to content

Commit a145c84

Browse files
Sebastian Andrzej Siewiorpetrpavlu
authored andcommitted
module: Extend the preempt disabled section in dereference_symbol_descriptor().
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: 04b8eb7 ("symbol lookup: introduce dereference_symbol_descriptor()") Cc: James E.J. Bottomley <[email protected]> Cc: Christophe Leroy <[email protected]> Cc: Helge Deller <[email protected]> Cc: Madhavan Srinivasan <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Naveen N Rao <[email protected]> Cc: Nicholas Piggin <[email protected]> Cc: Sergey Senozhatsky <[email protected]> Cc: [email protected] Cc: [email protected] Reviewed-by: Sergey Senozhatsky <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Petr Pavlu <[email protected]>
1 parent ffd294d commit a145c84

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/kallsyms.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ static inline void *dereference_symbol_descriptor(void *ptr)
5757

5858
preempt_disable();
5959
mod = __module_address((unsigned long)ptr);
60-
preempt_enable();
6160

6261
if (mod)
6362
ptr = dereference_module_function_descriptor(mod, ptr);
63+
preempt_enable();
6464
#endif
6565
return ptr;
6666
}

0 commit comments

Comments
 (0)