]> www.infradead.org Git - users/jedix/linux-maple.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)
committerDhaval Giani <dhaval.giani@oracle.com>
Fri, 20 Jan 2017 22:22:00 +0000 (17:22 -0500)
commit6a53def3155be8e1bc02e8a3b30d100e0a9baf2f
tree0f9d0e6e7325f7c8197e4287c94c14b90c1fa9d0
parent3ca0435cb8b5fab036eee6bfba9e17d60f5fdad1
net: validate variable length ll headers

Orabug: 25308053

[ 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: Sasha Levin <sasha.levin@oracle.com>
(cherry picked from commit 1df16498dfd0d5a129bdf2982d9a08df73e8923d)
Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
[dhaval.giani@oracle.com: Fixup KABI breakage in include/linux/netdevice.h]

Signed-off-by: Dhaval Giani <dhaval.giani@oracle.com>
include/linux/netdevice.h