]> git.baikalelectronics.ru Git - kernel.git/commit
mpls: Properly validate RTA_VIA payload length
authorRobert Shearman <rshearma@brocade.com>
Fri, 6 Mar 2015 10:47:00 +0000 (10:47 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 6 Mar 2015 20:19:06 +0000 (15:19 -0500)
commitc5e84e20bfd29e9701ec37d137dfdcf460b82927
treebd55bad628a3ddcbc94d6d75131f318732aec60a
parent02eb4bad03b0001f63edcab78dc83d5ece7d04ea
mpls: Properly validate RTA_VIA payload length

If the nla length is less than 2 then the nla data could be accessed
beyond the accessible bounds. So ensure that the nla is big enough to
at least read the via_family before doing so. Replace magic value of
2.

Fixes: 363c15ace2e4 ("mpls: Basic support for adding and removing routes")
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Robert Shearman <rshearma@brocade.com>
Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mpls/af_mpls.c