packet: validate variable length ll headers
authorWillem de Bruijn <willemb@google.com>
Thu, 10 Mar 2016 02:58:34 +0000 (21:58 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Mar 2016 03:13:01 +0000 (22:13 -0500)
commit9ed988cd591500c040b2a6257bc68543e08ceeef
tree5044c8b8a7af7aa6c9bf017a51da01f3ca334274
parentea47781c26510e5d97f80f9aceafe9065bd5e3aa
packet: validate variable length ll headers

Replace link layer header validation check ll_header_truncate with
more generic dev_validate_header.

Validation based on hard_header_len incorrectly drops valid packets
in variable length protocols, such as AX25. dev_validate_header
calls header_ops.validate for such protocols to ensure correctness
below hard_header_len.

See also http://comments.gmane.org/gmane.linux.network/401064

Fixes 9c7077622dd9 ("packet: make packet_snd fail on len smaller than l2 header")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c