Commit 2abf84f
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>1 parent 7d9dda6 commit 2abf84f
1 file changed
+9
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3703 | 3703 | | |
3704 | 3704 | | |
3705 | 3705 | | |
3706 | | - | |
3707 | 3706 | | |
3708 | 3707 | | |
3709 | | - | |
| 3708 | + | |
3710 | 3709 | | |
3711 | 3710 | | |
3712 | | - | |
| 3711 | + | |
3713 | 3712 | | |
3714 | 3713 | | |
3715 | | - | |
3716 | | - | |
3717 | | - | |
3718 | | - | |
3719 | | - | |
3720 | | - | |
3721 | | - | |
3722 | | - | |
| 3714 | + | |
3723 | 3715 | | |
3724 | | - | |
3725 | | - | |
| 3716 | + | |
| 3717 | + | |
| 3718 | + | |
| 3719 | + | |
| 3720 | + | |
3726 | 3721 | | |
3727 | | - | |
| 3722 | + | |
3728 | 3723 | | |
3729 | 3724 | | |
3730 | 3725 | | |
| |||
0 commit comments