summaryrefslogtreecommitdiff
path: root/rust/helpers/build_bug.c
diff options
context:
space:
mode:
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2025-01-08 12:04:42 +0300
committerPetr Pavlu <petr.pavlu@suse.com>2025-03-10 13:54:45 +0300
commit2abf84f688bed9cb4d3208d9d538b3387d292972 (patch)
tree911dc7647b173ceeb50752992c0574a93b42218f /rust/helpers/build_bug.c
parent7d9dda6f628fde3d227a69bec6a82160577b79ca (diff)
downloadlinux-2abf84f688bed9cb4d3208d9d538b3387d292972.tar.xz
module: Use RCU in search_module_extables().
search_module_extables() returns an exception_table_entry belonging to a module. The lookup via __module_address() can be performed with RCU protection. The returned exception_table_entry remains valid because the passed address usually belongs to a module that is currently executed. So the module can not be removed because "something else" holds a reference to it, ensuring that it can not be removed. Exceptions here are: - kprobe, acquires a reference on the module beforehand - MCE, invokes the function from within a timer and the RCU lifetime guarantees (of the timer) are sufficient. Therefore it is safe to return the exception_table_entry outside the RCU section which provided the module. Use RCU for the lookup in search_module_extables() and update the comment. 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-14-bigeasy@linutronix.de Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Diffstat (limited to 'rust/helpers/build_bug.c')
0 files changed, 0 insertions, 0 deletions