Re: [PATCH] parisc: fix race in iosapic_unmask_irq() missing spinlock
From: Helge Deller
Date: Fri Dec 04 2026 - 14:14:50 EST
On 12/4/26 10:57, zhangjiao2 wrote:
From: zhang jiao <zhangjiao2@xxxxxxxxxxxxxxxxxxxx>Thanks for the patches, zhang jiao!
iosapic_unmask_irq() performs an IRDT entry write via
iosapic_set_irt_data() + iosapic_wr_irt_entry() without holding
iosapic_lock, while both iosapic_mask_irq() and
iosapic_set_affinity_irq() correctly hold the lock during similar
read-modify-write operations on the same hardware register.
This creates a race condition where iosapic_unmask_irq() can interleave
its two 32-bit writes to the IRDT entry with writes from a concurrent
set_affinity call, producing a corrupted hardware entry.
Add the missing spin_lock_irqsave/spin_unlock_irqrestore pair around
the IRDT write, matching the pattern used by the mask and set_affinity
callbacks.
Signed-off-by: zhang jiao <zhangjiao2@xxxxxxxxxxxxxxxxxxxx>
---
drivers/parisc/iosapic.c | 3 +++
1 file changed, 3 insertions(+)
I've applied all 4 patches.
Thanks!
Helge