netem: fix skb_orphan_partial()
authorEric Dumazet <edumazet@google.com>
Thu, 11 May 2017 22:24:41 +0000 (15:24 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 May 2017 01:32:48 +0000 (21:32 -0400)
commitf6ba8d33cfbb46df569972e64dbb5bb7e929bfd9
treea341e4360d881c74496da6f86d7127a9ffe65191
parent4e3c60ed2f594e4ec6bb81d71ef6993e60f740d8
netem: fix skb_orphan_partial()

I should have known that lowering skb->truesize was dangerous :/

In case packets are not leaving the host via a standard Ethernet device,
but looped back to local sockets, bad things can happen, as reported
by Michael Madsen ( https://bugzilla.kernel.org/show_bug.cgi?id=195713 )

So instead of tweaking skb->truesize, lets change skb->destructor
and keep a reference on the owner socket via its sk_refcnt.

Fixes: f2f872f9272a ("netem: Introduce skb_orphan_partial() helper")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Michael Madsen <mkm@nabto.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/sock.c