]> git.baikalelectronics.ru Git - kernel.git/commit
net: Fix potential wrong skb->protocol in skb_vlan_untag()
authorMiaohe Lin <linmiaohe@huawei.com>
Sat, 15 Aug 2020 08:44:31 +0000 (04:44 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sun, 16 Aug 2020 22:33:49 +0000 (15:33 -0700)
commitcc55784622fd45810193efc5b5e34bb76fede626
treec75b285de0dca2367dbe68eee0252ea49ed24eb7
parentd520c8999eea679fcd6e141a0f9fb13c9ac55eb1
net: Fix potential wrong skb->protocol in skb_vlan_untag()

We may access the two bytes after vlan_hdr in vlan_set_encap_proto(). So
we should pull VLAN_HLEN + sizeof(unsigned short) in skb_vlan_untag() or
we may access the wrong data.

Fixes: 63b91351a255 ("net: Always untag vlan-tagged traffic on input.")
Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/skbuff.c