]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6/addrconf: only check invalid header values when NETLINK_F_STRICT_CHK is set
authorHangbin Liu <liuhangbin@gmail.com>
Wed, 11 Dec 2019 14:20:16 +0000 (22:20 +0800)
committerJakub Kicinski <jakub.kicinski@netronome.com>
Sat, 14 Dec 2019 01:13:49 +0000 (17:13 -0800)
commit6011ef9741fb2d5777201344bb8677e396a53b34
tree95376d3e7ce5564bd7a83a6f1cd6ed6629c18d4f
parentb6e19444ed1311af109b1b3e8ad27e68ad22f28f
ipv6/addrconf: only check invalid header values when NETLINK_F_STRICT_CHK is set

In commit 5d18ece0e9eb ("net: ipv6: addr: perform strict checks also for
doit handlers") we add strict check for inet6_rtm_getaddr(). But we did
the invalid header values check before checking if NETLINK_F_STRICT_CHK
is set. This may break backwards compatibility if user already set the
ifm->ifa_prefixlen, ifm->ifa_flags, ifm->ifa_scope in their netlink code.

I didn't move the nlmsg_len check because I thought it's a valid check.

Reported-by: Jianlin Shi <jishi@redhat.com>
Fixes: 5d18ece0e9eb ("net: ipv6: addr: perform strict checks also for doit handlers")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
net/ipv6/addrconf.c