ieee802154/at231rf230: deadlock in at86rf230_xmit
Subsystems (2)
PATCH 1/1 ieee802154/at231rf230: deadlock in at86rf230_xmit
spin_lock(&lp->lock) is used in at86rf230_isr interrupt handler and in at86rf230_xmit callback to protect lp->irq_disabled. It seems that deadlock is possible, because:at86rf230_xmit
spin_lock(&lp->lock); // acquired
// interruptat86rf230_isr
spin_lock(&lp->lock); // deadlock
To prevent it, spin_lock_irq* should be used in xmit callback.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by Denis Efremov <[email protected]>
--- drivers/net/ieee802154/at86rf230.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ieee802154/at86rf230.c +3 -3
@@ -543,12 +543,12 @@ at86rf230_xmit(struct ieee802154_dev *dev, struct sk_buff *skb)int rc;unsigned long flags; -spin_lock (&lp->lock); +spin_lock_irqsave (&lp->lock, flags);if (lp->irq_disabled) { -spin_unlock (&lp->lock); +spin_unlock_irqrestore (&lp->lock, flags);return -EBUSY ; } -spin_unlock (&lp->lock); +spin_unlock_irqrestore (&lp->lock, flags);might_sleep ();
Signature · 1 line
1.8.1.2
David Miller
maintainerlinux-kernel is not the correct mailing list to post networking patches, [email protected] is, thank you.