Skip to content

Commit 80f8b45

Browse files
committed
Merge tag 'irq-urgent-2024-05-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq fix from Ingo Molnar: "Fix suspicious RCU usage in __do_softirq()" * tag 'irq-urgent-2024-05-05' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: softirq: Fix suspicious RCU usage in __do_softirq()
2 parents b915881 + 1dd1eff commit 80f8b45

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

kernel/softirq.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ static inline bool lockdep_softirq_start(void) { return false; }
508508
static inline void lockdep_softirq_end(bool in_hardirq) { }
509509
#endif
510510

511-
asmlinkage __visible void __softirq_entry __do_softirq(void)
511+
static void handle_softirqs(bool ksirqd)
512512
{
513513
unsigned long end = jiffies + MAX_SOFTIRQ_TIME;
514514
unsigned long old_flags = current->flags;
@@ -563,8 +563,7 @@ asmlinkage __visible void __softirq_entry __do_softirq(void)
563563
pending >>= softirq_bit;
564564
}
565565

566-
if (!IS_ENABLED(CONFIG_PREEMPT_RT) &&
567-
__this_cpu_read(ksoftirqd) == current)
566+
if (!IS_ENABLED(CONFIG_PREEMPT_RT) && ksirqd)
568567
rcu_softirq_qs();
569568

570569
local_irq_disable();
@@ -584,6 +583,11 @@ asmlinkage __visible void __softirq_entry __do_softirq(void)
584583
current_restore_flags(old_flags, PF_MEMALLOC);
585584
}
586585

586+
asmlinkage __visible void __softirq_entry __do_softirq(void)
587+
{
588+
handle_softirqs(false);
589+
}
590+
587591
/**
588592
* irq_enter_rcu - Enter an interrupt context with RCU watching
589593
*/
@@ -921,7 +925,7 @@ static void run_ksoftirqd(unsigned int cpu)
921925
* We can safely run softirq on inline stack, as we are not deep
922926
* in the task stack here.
923927
*/
924-
__do_softirq();
928+
handle_softirqs(true);
925929
ksoftirqd_run_end();
926930
cond_resched();
927931
return;

0 commit comments

Comments
 (0)