]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
net: Improve handling of failures on link and route dumps
authorDavid Ahern <dsahern@gmail.com>
Tue, 16 May 2017 06:19:17 +0000 (23:19 -0700)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Tue, 27 Jun 2017 13:16:15 +0000 (10:16 -0300)
commit91b2e6b0188f8e5208bad1e4fef9face7bdaff52
tree308f2bfdca93d6aac453bf7363869b9b4d88223f
parente0f8ed33e592fc8f0993261cd789b93b6b8815ec
net: Improve handling of failures on link and route dumps

BugLink: http://bugs.launchpad.net/bugs/1697001
[ Upstream commit f6c5775ff0bfa62b072face6bf1d40f659f194b2 ]

In general, rtnetlink dumps do not anticipate failure to dump a single
object (e.g., link or route) on a single pass. As both route and link
objects have grown via more attributes, that is no longer a given.

netlink dumps can handle a failure if the dump function returns an
error; specifically, netlink_dump adds the return code to the response
if it is <= 0 so userspace is notified of the failure. The missing
piece is the rtnetlink dump functions returning the error.

Fix route and link dump functions to return the errors if no object is
added to an skb (detected by skb->len != 0). IPv6 route dumps
(rt6_dump_route) already return the error; this patch updates IPv4 and
link dumps. Other dump functions may need to be ajusted as well.

Reported-by: Jan Moskyto Matejka <mq@ucw.cz>
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
net/core/rtnetlink.c
net/ipv4/fib_frontend.c
net/ipv4/fib_trie.c