OSDN Git Service

veth: use skb_orphan_partial instead of skb_orphan
authorPaolo Abeni <pabeni@redhat.com>
Fri, 9 Apr 2021 11:04:37 +0000 (13:04 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 11 Apr 2021 23:39:28 +0000 (16:39 -0700)
commitc75fb320d482a5ce6e522378d137fd2c3bf79225
tree72238a58f381c016d1f32b1fe01bd833a6ae47e5
parent7dc85b599ae17fb705ffae1b7321ace4b3056aeb
veth: use skb_orphan_partial instead of skb_orphan

As described by commit 9c4c325252c5 ("skbuff: preserve sock
reference when scrubbing the skb."), orphaning a skb
in the TX path will cause OoO.

Let's use skb_orphan_partial() instead of skb_orphan(), so
that we keep the sk around for queue's selection sake and we
still avoid the problem fixed with commit 4bf9ffa0fb57 ("veth:
Orphan skb before GRO")

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/veth.c