net: fix sk_forward_alloc corruption

On UDP sockets, we must call skb_free_datagram() with socket locked,
or risk sk_forward_alloc corruption. This requirement is not respected
in SUNRPC.

Add a convenient helper, skb_free_datagram_locked() and use it in SUNRPC

Reported-by: Francis Moreau <francis.moro@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Eric Dumazet
2009-10-30 05:03:53 +00:00
committed by David S. Miller
parent 63ca2d74ea
commit 9d410c7960
5 changed files with 18 additions and 12 deletions

View File

@@ -999,9 +999,7 @@ try_again:
err = ulen;
out_free:
lock_sock(sk);
skb_free_datagram(sk, skb);
release_sock(sk);
skb_free_datagram_locked(sk, skb);
out:
return err;