]> www.infradead.org Git - users/jedix/linux-maple.git/commit
packet: only allow extra vlan len on ethernet devices
authorDaniel Borkmann <daniel@iogearbox.net>
Wed, 11 Nov 2015 22:25:42 +0000 (23:25 +0100)
committerDhaval Giani <dhaval.giani@oracle.com>
Fri, 20 Jan 2017 22:22:00 +0000 (17:22 -0500)
commit57d0ef310cd4e375ae1e1c137969bb0d9a6024b5
treed592e6614953718fc17c47846d26a92bb44c4b33
parent9a7532ebe21641bfa002a5335d2cb049158d22bc
packet: only allow extra vlan len on ethernet devices

Orabug: 25308051

[ Upstream commit 3c70c132488794e2489ab045559b0ce0afcf17de ]

Packet sockets can be used by various net devices and are not
really restricted to ARPHRD_ETHER device types. However, when
currently checking for the extra 4 bytes that can be transmitted
in VLAN case, our assumption is that we generally probe on
ARPHRD_ETHER devices. Therefore, before looking into Ethernet
header, check the device type first.

This also fixes the issue where non-ARPHRD_ETHER devices could
have no dev->hard_header_len in TX_RING SOCK_RAW case, and thus
the check would test unfilled linear part of the skb (instead
of non-linear).

Fixes: 57f89bfa2140 ("network: Allow af_packet to transmit +4 bytes for VLAN packets.")
Fixes: 52f1454f629f ("packet: allow to transmit +4 byte in TX_RING slot for VLAN case")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit c59fd2eaa2b6c98233d1d264153335c202c4163d)
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
net/packet/af_packet.c