OSDN Git Service

rtnetlink: Update fib dumps for strict data checking
authorDavid Ahern <dsahern@gmail.com>
Mon, 8 Oct 2018 03:16:35 +0000 (20:16 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 8 Oct 2018 17:39:05 +0000 (10:39 -0700)
commite8ba330ac0c55004e775eab53fa1e748e5d71bdb
tree7395f21e571ed0d138ec5c6981cecab92942bb1f
parent14fc5bb29fe78aaa1777cfee248339497e30c02e
rtnetlink: Update fib dumps for strict data checking

Add helper to check netlink message for route dumps. If the strict flag
is set the dump request is expected to have an rtmsg struct as the header.
All elements of the struct are expected to be 0 with the exception of
rtm_flags (which is used by both ipv4 and ipv6 dumps) and no attributes
can be appended. rtm_flags can only have RTM_F_CLONED and RTM_F_PREFIX
set.

Update inet_dump_fib, inet6_dump_fib, mpls_dump_routes, ipmr_rtm_dumproute,
and ip6mr_rtm_dumproute to call this helper if strict data checking is
enabled.

Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ip_fib.h
net/ipv4/fib_frontend.c
net/ipv4/ipmr.c
net/ipv6/ip6_fib.c
net/ipv6/ip6mr.c
net/mpls/af_mpls.c