]> Git Repo - linux.git/commit
net/core: check length before updating Ethertype in skb_mpls_{push,pop}
authorGuillaume Nault <[email protected]>
Fri, 2 Oct 2020 19:53:08 +0000 (21:53 +0200)
committerDavid S. Miller <[email protected]>
Sun, 4 Oct 2020 22:09:26 +0000 (15:09 -0700)
commit4296adc3e32f5d544a95061160fe7e127be1b9ff
tree2f43479d747def5e6782893e35dbf998b6e2a4ea
parentf4544e5361da5050ff5c0330ceea095cb5dbdd72
net/core: check length before updating Ethertype in skb_mpls_{push,pop}

Openvswitch allows to drop a packet's Ethernet header, therefore
skb_mpls_push() and skb_mpls_pop() might be called with ethernet=true
and mac_len=0. In that case the pointer passed to skb_mod_eth_type()
doesn't point to an Ethernet header and the new Ethertype is written at
unexpected locations.

Fix this by verifying that mac_len is big enough to contain an Ethernet
header.

Fixes: fa4e0f8855fc ("net/sched: fix corrupted L2 header with MPLS 'push' and 'pop' actions")
Signed-off-by: Guillaume Nault <[email protected]>
Acked-by: Davide Caratti <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/core/skbuff.c
This page took 0.044286 seconds and 4 git commands to generate.