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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 10 Dec 2008 15:15:28 +0200
From:	Rémi Denis-Courmont 
	<remi.denis-courmont@...ia.com>
To:	netdev@...r.kernel.org
Subject: [PATCH net] Phonet: ensure GPRS device does not go away during TX work

We need to hold the device while TX work is pending, as work is flushed
only after the network device is unregistered.

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@...ia.com>
---
 net/phonet/pep-gprs.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/phonet/pep-gprs.c b/net/phonet/pep-gprs.c
index e6e8e44..5985bc5 100644
--- a/net/phonet/pep-gprs.c
+++ b/net/phonet/pep-gprs.c
@@ -184,6 +184,7 @@ static int gprs_xmit(struct sk_buff *skb, struct net_device *net)
 	spin_lock(&dev->tx_lock);
 	if (likely(skb_queue_len(&dev->tx_queue) < dev->tx_max)) {
 		skb_queue_tail(&dev->tx_queue, skb);
+		dev_hold(net);
 		skb = NULL;
 	}
 	if (skb_queue_len(&dev->tx_queue) >= dev->tx_max)
@@ -221,6 +222,7 @@ static void gprs_tx(struct work_struct *work)
 			net->stats.tx_errors++;
 		}
 		release_sock(sk);
+		dev_put(net);
 	}
 
 	lock_sock(sk);
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ