Skip to content

Commit 9843d30

Browse files
Sebastian Andrzej SiewiorSherryYang1
authored andcommitted
module: Extend the preempt disabled section in dereference_symbol_descriptor().
[ Upstream commit a145c84 ] 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]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 9fdcd0038b4c9aa7c7aa39484f9ead8eabac1f5f) Signed-off-by: Sherry Yang <[email protected]>
1 parent c0a0b97 commit 9843d30

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
@@ -63,10 +63,10 @@ static inline void *dereference_symbol_descriptor(void *ptr)
6363

6464
preempt_disable();
6565
mod = __module_address((unsigned long)ptr);
66-
preempt_enable();
6766

6867
if (mod)
6968
ptr = dereference_module_function_descriptor(mod, ptr);
69+
preempt_enable();
7070
#endif
7171
return ptr;
7272
}

0 commit comments

Comments
 (0)