From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Ahern Subject: Re: [PATCH net-next 00/20] rtnetlink: Add support for rigid checking of data in dump request Date: Fri, 5 Oct 2018 15:18:11 -0600 Message-ID: <73fb03a7-ab31-f6a4-d961-bcc42dccf68f@gmail.com> References: <20181004213355.14899-1-dsahern@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: christian@brauner.io, jbenc@redhat.com, stephen@networkplumber.org To: David Ahern , netdev@vger.kernel.org, davem@davemloft.net Return-path: Received: from mail-pl1-f195.google.com ([209.85.214.195]:45897 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725787AbeJFESq (ORCPT ); Sat, 6 Oct 2018 00:18:46 -0400 Received: by mail-pl1-f195.google.com with SMTP id y15-v6so7366400plr.12 for ; Fri, 05 Oct 2018 14:18:14 -0700 (PDT) In-Reply-To: <20181004213355.14899-1-dsahern@kernel.org> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: On 10/4/18 3:33 PM, David Ahern wrote: > From: David Ahern ... > This patch set addresses the problem by adding a new socket flag, > NETLINK_DUMP_STRICT_CHK, that userspace can use with setsockopt to > request strict checking of headers and attributes on dump requests and > hence unlock the ability to use kernel side filters as they are added. ... > David Ahern (20): > netlink: Pass extack to dump handlers > netlink: Add extack message to nlmsg_parse for invalid header length > net: Add extack to nlmsg_parse > net/ipv6: Refactor address dump to push inet6_fill_args to > in6_dump_addrs > netlink: Add new socket option to enable strict checking on dumps > net/ipv4: Update inet_dump_ifaddr for strict data checking > net/ipv6: Update inet6_dump_addr for strict data checking > rtnetlink: Update rtnl_dump_ifinfo for strict data checking > rtnetlink: Update rtnl_bridge_getlink for strict data checking > rtnetlink: Update rtnl_stats_dump for strict data checking > rtnetlink: Update inet6_dump_ifinfo for strict data checking > rtnetlink: Update ipmr_rtm_dumplink for strict data checking > rtnetlink: Update fib dumps for strict data checking > net/neighbor: Update neigh_dump_info for strict data checking > net/neighbor: Update neightbl_dump_info for strict data checking > net/namespace: Update rtnl_net_dumpid for strict data checking > net/fib_rules: Update fib_nl_dumprule for strict data checking > net/ipv6: Update ip6addrlbl_dump for strict data checking > net: Update netconf dump handlers for strict data checking > net/bridge: Update br_mdb_dump for strict data checking > One thing I missed in the rfc and v1 versions is strict attribute parsing -- ie., there should be nothing remaining after nla_parse is done. I have a new patch that adds an nlmsg_parse_strict and nla_parse_strict that returns -EINVAL (with extack filled in) if that happens. The new patch pushes the set over 20. I can peel off the first 3 patches from this set which add extack to the dumps and down to nlmsg_parse and send those separately if preferred.