Home Home > GIT Browse > SLE11-SP4
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiroslav Benes <mbenes@suse.cz>2018-06-13 13:39:31 +0200
committerMiroslav Benes <mbenes@suse.cz>2018-06-13 13:39:31 +0200
commite5a5ef53c05003a828e1282468f546fff9ea48b6 (patch)
tree297ebabc4501c09643a0ee4ebfcc7548f4871aeb
parent3a4c3dceb700a727763fbb834e0d5f020115aebf (diff)
module: Fix locking in symbol_put_addr() (bsc#1097445).
-rw-r--r--kernel/module.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/module.c b/kernel/module.c
index e76aad98496f..5f3a8cec9bb5 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -979,11 +979,15 @@ void symbol_put_addr(void *addr)
if (core_kernel_text(a))
return;
- /* module_text_address is safe here: we're supposed to have reference
- * to module from symbol_get, so it can't go away. */
+ /*
+ * Even though we hold a reference on the module; we still need to
+ * disable preemption in order to safely traverse the data structure.
+ */
+ preempt_disable();
modaddr = __module_text_address(a);
BUG_ON(!modaddr);
module_put(modaddr);
+ preempt_enable();
}
EXPORT_SYMBOL_GPL(symbol_put_addr);