Commit 4296adc
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: fa4e0f8 ("net/sched: fix corrupted L2 header with MPLS 'push' and 'pop' actions")
Signed-off-by: Guillaume Nault <gnault@redhat.com>
Acked-by: Davide Caratti <dcaratti@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent f4544e5 commit 4296adc
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5622 | 5622 | | |
5623 | 5623 | | |
5624 | 5624 | | |
5625 | | - | |
| 5625 | + | |
5626 | 5626 | | |
5627 | 5627 | | |
5628 | 5628 | | |
| |||
5662 | 5662 | | |
5663 | 5663 | | |
5664 | 5664 | | |
5665 | | - | |
| 5665 | + | |
5666 | 5666 | | |
5667 | 5667 | | |
5668 | 5668 | | |
| |||
0 commit comments