[PATCH] macvtap: remove wrong sock_put() in macvtap_put_queue()

Subsystems: networking drivers, the rest

STALE5526d

2 messages, 2 authors, 2011-06-17 · open the first message on its own page

[PATCH] macvtap: remove wrong sock_put() in macvtap_put_queue()

From: Jason Wang <hidden>
Date: 2011-06-13 03:14:21

The calling of sock_put() should be delayed after synchronize_rcu(),
otherwise inconsist data may be seen during packets transmitting.

Signed-off-by: Jason Wang <redacted>
---
 drivers/net/macvtap.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 6696e56..ecdb775 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -148,7 +148,6 @@ static void macvtap_put_queue(struct macvtap_queue *q)
 
 		rcu_assign_pointer(vlan->taps[index], NULL);
 		rcu_assign_pointer(q->vlan, NULL);
-		sock_put(&q->sk);
 		--vlan->numvtaps;
 	}
 
-- 
1.7.1

Re: [PATCH] macvtap: remove wrong sock_put() in macvtap_put_queue()

From: David Miller <davem@davemloft.net>
Date: 2011-06-17 02:58:36

From: Jason Wang <redacted>
Date: Mon, 13 Jun 2011 11:15:19 +0800
The calling of sock_put() should be delayed after synchronize_rcu(),
otherwise inconsist data may be seen during packets transmitting.

Signed-off-by: Jason Wang <redacted>
You're leaking sockets now.

This function has to release the socket twice if there is
a non-NULL vlan assigned to the queue.

Now you're only doing it once in that situation.

Which probably fixes your crash, but adds a socket leak.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help