Skip to content

Commit 3b35375

Browse files
committed
Merge tag 'irq-urgent-2023-08-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq fix from Thomas Gleixner: "A last minute fix for a regression introduced in the v6.5 merge window. The conversion of the software based interrupt resend mechanism to hlist missed to add a check whether the descriptor is already enqueued and dropped the interrupt descriptor lookup for nested interrupts. The missing check whether the descriptor is already queued causes hlist corruption and can be observed in the wild. The dropped parent descriptor lookup has not yet caused problems, but it would result in stale interrupt line in the worst case. Add the missing enqueued check and bring the descriptor lookup back to cure this" * tag 'irq-urgent-2023-08-26' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: genirq: Fix software resend lockup and nested resend
2 parents c313761 + 9f5deb5 commit 3b35375

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

kernel/irq/resend.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,16 @@ static int irq_sw_resend(struct irq_desc *desc)
6868
*/
6969
if (!desc->parent_irq)
7070
return -EINVAL;
71+
72+
desc = irq_to_desc(desc->parent_irq);
73+
if (!desc)
74+
return -EINVAL;
7175
}
7276

7377
/* Add to resend_list and activate the softirq: */
7478
raw_spin_lock(&irq_resend_lock);
75-
hlist_add_head(&desc->resend_node, &irq_resend_list);
79+
if (hlist_unhashed(&desc->resend_node))
80+
hlist_add_head(&desc->resend_node, &irq_resend_list);
7681
raw_spin_unlock(&irq_resend_lock);
7782
tasklet_schedule(&resend_tasklet);
7883
return 0;

0 commit comments

Comments
 (0)