]> git.baikalelectronics.ru Git - kernel.git/commit
skbuff: revert "skbuff: remove some unnecessary operation in skb_segment_list()"
authorPaolo Abeni <pabeni@redhat.com>
Wed, 14 Apr 2021 10:48:48 +0000 (12:48 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 14 Apr 2021 20:54:08 +0000 (13:54 -0700)
commit63546db8e8de39a8e004b46b853adf6e4bf8b2d5
treec55a71950000467a7691fc7ace2b3c1fd82c70a4
parent17ce7b6842fd690dc3991c950da3bc18e071426c
skbuff: revert "skbuff: remove some unnecessary operation in skb_segment_list()"

the commit b90788be0015 ("skbuff: remove some unnecessary operation
in skb_segment_list()") introduces an issue very similar to the
one already fixed by commit 3038a437dc22 ("net: fix use-after-free when
UDP GRO with shared fraglist").

If the GSO skb goes though skb_clone() and pskb_expand_head() before
entering skb_segment_list(), the latter  will unshare the frag_list
skbs and will release the old list. With the reverted commit in place,
when skb_segment_list() completes, skb->next points to the just
released list, and later on the kernel will hit UaF.

Note that since commit 3b3d47a9d84e ("udp: properly complete L4 GRO
over UDP tunnel packet") the critical scenario can be reproduced also
receiving UDP over vxlan traffic with:

NIC (NETIF_F_GRO_FRAGLIST enabled) -> vxlan -> UDP sink

Attaching a packet socket to the NIC will cause skb_clone() and the
tunnel decapsulation will call pskb_expand_head().

Fixes: b90788be0015 ("skbuff: remove some unnecessary operation in skb_segment_list()")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/skbuff.c