It should be safe to remove preempt_disable() here. It was introduced in
commit a189d0350f387 ("kprobes: disable preempt for module_text_address()
and kernel_text_address()") to protect against module removal. This is
however wrong (now) because the RCU list which is used requires a RCU
readlock. The comment in __module_text_address() has been updated and the
caller, too.
I *think* this preempt_disable() may go now.

Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
---
 kernel/kprobes.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index a2d4e5164d7d..92d50ea83564 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1438,7 +1438,6 @@ static int check_kprobe_address_safe(struct kprobe *p,
        if (ret)
                return ret;
        jump_label_lock();
-       preempt_disable();
 
        /* Ensure it is not in reserved area nor out of text */
        if (!kernel_text_address((unsigned long) p->addr) ||
@@ -1475,7 +1474,6 @@ static int check_kprobe_address_safe(struct kprobe *p,
 out_rcu_unlock:
        rcu_read_unlock();
 out:
-       preempt_enable();
        jump_label_unlock();
 
        return ret;
-- 
2.4.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to