]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
net: validate variable length ll headers
authorWillem de Bruijn <willemb@google.com>
Thu, 10 Mar 2016 02:58:32 +0000 (21:58 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Apr 2016 06:42:00 +0000 (15:42 +0900)
commit8b8d278aa4de9335682bbd4a3bb619af015c859e
tree206439f2b6ac4cff73a10959c2fb5fdce2b4e91a
parentcd8101d8ece8d776b79b7e0528cc8ba6d6c33562
net: validate variable length ll headers

[ Upstream commit 2793a23aacbd754dbbb5cb75093deb7e4103bace ]

Netdevice parameter hard_header_len is variously interpreted both as
an upper and lower bound on link layer header length. The field is
used as upper bound when reserving room at allocation, as lower bound
when validating user input in PF_PACKET.

Clarify the definition to be maximum header length. For validation
of untrusted headers, add an optional validate member to header_ops.

Allow bypassing of validation by passing CAP_SYS_RAWIO, for instance
for deliberate testing of corrupt input. In this case, pad trailing
bytes, as some device drivers expect completely initialized headers.

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

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>
include/linux/netdevice.h