lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1333981366-27145-1-git-send-email-richard@nod.at>
Date:	Mon,  9 Apr 2012 16:22:46 +0200
From:	Richard Weinberger <richard@....at>
To:	user-mode-linux-devel@...ts.sourceforge.net
Cc:	linux-kernel@...r.kernel.org, tglx@...utronix.de,
	Richard Weinberger <richard@....at>
Subject: [PATCH] um: Fix spin_lock usage in uml_net_interrupt()

Use spin_lock_save/restore() in uml_net_interrupt() to
avoid recursive locking.

Signed-off-by: Richard Weinberger <richard@....at>
---
 arch/um/drivers/net_kern.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/um/drivers/net_kern.c b/arch/um/drivers/net_kern.c
index 95f4416..5e7cf82 100644
--- a/arch/um/drivers/net_kern.c
+++ b/arch/um/drivers/net_kern.c
@@ -116,12 +116,13 @@ static irqreturn_t uml_net_interrupt(int irq, void *dev_id)
 {
 	struct net_device *dev = dev_id;
 	struct uml_net_private *lp = netdev_priv(dev);
+	unsigned long flags;
 	int err;
 
 	if (!netif_running(dev))
 		return IRQ_NONE;
 
-	spin_lock(&lp->lock);
+	spin_lock_irqsave(&lp->lock, flags);
 	while ((err = uml_net_rx(dev)) > 0) ;
 	if (err < 0) {
 		printk(KERN_ERR
@@ -140,7 +141,7 @@ static irqreturn_t uml_net_interrupt(int irq, void *dev_id)
 	reactivate_fd(lp->fd, UM_ETH_IRQ);
 
 out:
-	spin_unlock(&lp->lock);
+	spin_unlock_irqrestore(&lp->lock, flags);
 	return IRQ_HANDLED;
 }
 
-- 
1.7.7.3

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ