Commit 9117c89
packet: round up linear to header len
[ Upstream commit 57031eb794906eea4e1c7b31dc1e2429c0af0c66 ]
Link layer protocols may unconditionally pull headers, as Ethernet
does in eth_type_trans. Ensure that the entire link layer header
always lies in the skb linear segment. tpacket_snd has such a check.
Extend this to packet_snd.
Variable length link layer headers complicate the computation
somewhat. Here skb->len may be smaller than dev->hard_header_len.
Round up the linear length to be at least as long as the smallest of
the two.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 58691e5 commit 9117c89
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2637 | 2637 | | |
2638 | 2638 | | |
2639 | 2639 | | |
2640 | | - | |
| 2640 | + | |
2641 | 2641 | | |
2642 | 2642 | | |
2643 | 2643 | | |
| |||
2741 | 2741 | | |
2742 | 2742 | | |
2743 | 2743 | | |
2744 | | - | |
2745 | | - | |
| 2744 | + | |
| 2745 | + | |
| 2746 | + | |
2746 | 2747 | | |
2747 | 2748 | | |
2748 | 2749 | | |
| |||
0 commit comments