]> git.baikalelectronics.ru Git - kernel.git/commit
packet: validate msg_namelen in send directly
authorWillem de Bruijn <willemb@google.com>
Mon, 29 Apr 2019 15:53:18 +0000 (11:53 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 May 2019 15:28:35 +0000 (11:28 -0400)
commit6b93c2c3d561f5a6954ade3a2e7b7f23252c623e
tree38f6396a1f53717bdd1247a75abb4e632fe2e2ea
parent04eba182a55b017582144c42ac5f8031f24bab0c
packet: validate msg_namelen in send directly

Packet sockets in datagram mode take a destination address. Verify its
length before passing to dev_hard_header.

Prior to 2.6.14-rc3, the send code ignored sll_halen. This is
established behavior. Directly compare msg_namelen to dev->addr_len.

Change v1->v2: initialize addr in all paths

Fixes: 7124972299368 ("packet: validate address length if non-zero")
Suggested-by: David Laight <David.Laight@aculab.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/packet/af_packet.c