Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netlink: don't orphan skb in netlink_trim()

Netlink doesn't account skbs to the sending socket, so the there's no
need to orphan the skb before trimming it.

Removing the skb_orphan() call is required for mmap'ed netlink, which uses
a netlink specific skb destructor that must not be invoked before the
final freeing of the skb.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Patrick McHardy and committed by
David S. Miller
1298ca46 0ebd0ac5

+1 -1
+1 -1
net/netlink/af_netlink.c
··· 851 851 { 852 852 int delta; 853 853 854 - skb_orphan(skb); 854 + WARN_ON(skb->sk != NULL); 855 855 856 856 delta = skb->end - skb->tail; 857 857 if (delta * 2 < skb->truesize)