Commit db61ecc3 authored by Committed by David S. MillerBrowse files
[NETLINK]: Fix race with recvmsg().
This bug causes: assertion (!atomic_read(&sk->sk_rmem_alloc)) failed at net/netlink/af_netlink.c (122) What's happening is that: 1) The skb is sent to socket 1. 2) Someone does a recvmsg on socket 1 and drops the ref on the skb. Note that the rmalloc is not returned at this point since the skb is still referenced. 3) The same skb is now sent to socket 2. This version of the fix resurrects the skb_orphan call that was moved out, last time we had 'shared-skb troubles'. It is practically a no-op in the common case, but still prevents the possible race with recvmsg. Signed-off-by: Tommy S. Christensen <firstname.lastname@example.org> Acked-by: Herbert Xu <email@example.com> Signed-off-by: David S. Miller <firstname.lastname@example.org>