]> git.baikalelectronics.ru Git - kernel.git/commit
net: add a temporary sanity check in skb_orphan()
authorEric Dumazet <edumazet@google.com>
Thu, 1 Aug 2013 18:43:08 +0000 (11:43 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Aug 2013 19:49:28 +0000 (12:49 -0700)
commita782fe151d4f73a088352c726f6511eaaa833cc5
tree7f3218e1bc7cfbda553714a4d2c82c0eeb02d3be
parent52e0a597f9eb2af1c2f7af3fc314719bcb5ced39
net: add a temporary sanity check in skb_orphan()

David suggested to add a BUG_ON() to catch if some layer
sets skb->sk pointer without a corresponding destructor.

As skb can sit in a queue, it's mandatory to make sure the
socket cannot disappear, and it's usually done by taking a
reference on the socket, then releasing it from the skb
destructor.

This patch is a follow-up to commit 6a5b73a8019f
("net: skb_orphan() changes") and will be reverted after
catching all possible offenders if any.

Suggested-by: David Miller <davem@davemloft.net>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h