]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.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)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Mar 2016 03:13:01 +0000 (22:13 -0500)
commit2793a23aacbd754dbbb5cb75093deb7e4103bace
tree736ba574091e9959f0e47fa2be122b46f26e372d
parent9531ab65f4ec066a6e6617a08a293c60397a161b
net: validate variable length ll headers

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