macvtap: remove wrong sock_put() in macvtap_put_queue()
Subsystems (2)
PATCH 1/1 macvtap: remove wrong sock_put() in macvtap_put_queue()
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 <[email protected]>
--- drivers/net/macvtap.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/net/macvtap.c +0 -1
@@ -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; }
Signature · 1 line
1.7.1
David Miller
maintainerFrom: Jason Wang <[email protected]>
Date: Mon, 13 Jun 2011 11:15:19 +0800
Quoted 4 lines
The calling of
sock_put()should be delayed aftersynchronize_rcu(), otherwise inconsist data may be seen during packets transmitting.Signed-off-by Jason Wang <[email protected]>
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.