packet: validate address length
authorWillem de Bruijn <willemb@google.com>
Fri, 21 Dec 2018 17:06:59 +0000 (12:06 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Jan 2019 09:07:10 +0000 (10:07 +0100)
commit6a40c2da9c01785f089ca502edaf99a8e8eef4bc
treed1e53aeb6cf994d63e9bbee996d5954cce4b0f0a
parent1c85a9064fbf5dcd7a9d36355c36f423b5691d2e
packet: validate address length

[ Upstream commit 99137b7888f4058087895d035d81c6b2d31015c5 ]

Packet sockets with SOCK_DGRAM may pass an address for use in
dev_hard_header. Ensure that it is of sufficient length.

Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-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>
net/packet/af_packet.c