]> git.baikalelectronics.ru Git - kernel.git/commit
netlink: Relax attr validation for fixed length types
authorDavid Ahern <dsahern@gmail.com>
Thu, 7 Dec 2017 04:09:12 +0000 (20:09 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Dec 2017 19:00:57 +0000 (14:00 -0500)
commit1d9fbdfcafdb5d6290b87d741ad041c896cc8e13
tree5f9004968bce1a001bf348fa0a56b97fea94bd82
parent08986e23a274ad8ce0eae55687484d889c0f4a9e
netlink: Relax attr validation for fixed length types

Commit ea2779ad9493 ("net: netlink: Update attr validation to require
exact length for some types") requires attributes using types NLA_U* and
NLA_S* to have an exact length. This change is exposing bugs in various
userspace commands that are sending attributes with an invalid length
(e.g., attribute has type NLA_U8 and userspace sends NLA_U32). While
the commands are clearly broken and need to be fixed, users are arguing
that the sudden change in enforcement is breaking older commands on
newer kernels for use cases that otherwise "worked".

Relax the validation to print a warning mesage similar to what is done
for messages containing extra bytes after parsing.

Fixes: ea2779ad9493 ("net: netlink: Update attr validation to require exact length for some types")
Signed-off-by: David Ahern <dsahern@gmail.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
lib/nlattr.c