mbox series

[net-next,00/13] net: use strict checks in doit handlers

Message ID 20190117225300.8006-1-jakub.kicinski@netronome.com
Headers show
Series net: use strict checks in doit handlers | expand

Message

Jakub Kicinski Jan. 17, 2019, 10:52 p.m. UTC
Hi!

This series extends strict argument checking to doit handlers
of the GET* nature.  This is a bit tricky since strict checking
flag has already been released..

iproute2 did not have a release with strick checks enabled,
and it will only need a minor one-liner to pass strick checks
after all the work that DaveA has already done.

Big thanks to Dave Ahern for help and guidence.
DaveA, does this look good to you?

Jakub Kicinski (13):
  net: netlink: add helper to retrieve NETLINK_F_STRICT_CHK
  rtnetlink: stats: validate attributes in get as well as dumps
  rtnetlink: stats: reject requests for unknown stats
  rtnetlink: ifinfo: perform strict checks also for doit handler
  net: ipv4: perform strict checks also for doit handlers
  net: namespace: perform strict checks also for doit handlers
  net: ipv4: ipmr: perform strict checks also for doit handlers
  net: ipv6: addr: perform strict checks also for doit handlers
  net: ipv6: netconf: perform strict checks also for doit handlers
  net: ipv6: addrlabel: perform strict checks also for doit handlers
  net: ipv6: route: perform strict checks also for doit handlers
  net: mpls: route: perform strict checks also for doit handlers
  net: mpls: netconf: perform strict checks also for doit handlers

 include/linux/netlink.h  |   1 +
 net/core/net_namespace.c |  43 ++++++++++++++-
 net/core/rtnetlink.c     | 111 +++++++++++++++++++++++++++++++--------
 net/ipv4/devinet.c       |  43 +++++++++++++--
 net/ipv4/ipmr.c          |  61 +++++++++++++++++++--
 net/ipv6/addrconf.c      |  90 +++++++++++++++++++++++++++++--
 net/ipv6/addrlabel.c     |  47 ++++++++++++++++-
 net/ipv6/route.c         |  70 +++++++++++++++++++++++-
 net/mpls/af_mpls.c       | 103 ++++++++++++++++++++++++++++++++++--
 net/netlink/af_netlink.c |   8 +++
 10 files changed, 530 insertions(+), 47 deletions(-)

Comments

David Ahern Jan. 18, 2019, 2:45 p.m. UTC | #1
On 1/17/19 3:52 PM, Jakub Kicinski wrote:
> Hi!
> 
> This series extends strict argument checking to doit handlers
> of the GET* nature.  This is a bit tricky since strict checking
> flag has already been released..
> 
> iproute2 did not have a release with strick checks enabled,
> and it will only need a minor one-liner to pass strick checks
> after all the work that DaveA has already done.
> 
> Big thanks to Dave Ahern for help and guidence.
> DaveA, does this look good to you?
> 
> Jakub Kicinski (13):
>   net: netlink: add helper to retrieve NETLINK_F_STRICT_CHK
>   rtnetlink: stats: validate attributes in get as well as dumps
>   rtnetlink: stats: reject requests for unknown stats
>   rtnetlink: ifinfo: perform strict checks also for doit handler
>   net: ipv4: perform strict checks also for doit handlers
>   net: namespace: perform strict checks also for doit handlers
>   net: ipv4: ipmr: perform strict checks also for doit handlers
>   net: ipv6: addr: perform strict checks also for doit handlers
>   net: ipv6: netconf: perform strict checks also for doit handlers
>   net: ipv6: addrlabel: perform strict checks also for doit handlers
>   net: ipv6: route: perform strict checks also for doit handlers
>   net: mpls: route: perform strict checks also for doit handlers
>   net: mpls: netconf: perform strict checks also for doit handlers

Thanks for working on this. Besides the few nits, all of the changes
look good to me.

Looking at RTM_GET handlers I noticed inet_rtm_getroute and
rtnl_net_getid are not included in this set. Any reason?
Jakub Kicinski Jan. 18, 2019, 6:01 p.m. UTC | #2
On Fri, 18 Jan 2019 07:45:50 -0700, David Ahern wrote:
> On 1/17/19 3:52 PM, Jakub Kicinski wrote:
> > Hi!
> > 
> > This series extends strict argument checking to doit handlers
> > of the GET* nature.  This is a bit tricky since strict checking
> > flag has already been released..
> > 
> > iproute2 did not have a release with strick checks enabled,
> > and it will only need a minor one-liner to pass strick checks
> > after all the work that DaveA has already done.
> > 
> > Big thanks to Dave Ahern for help and guidence.
> > DaveA, does this look good to you?
> > 
> > Jakub Kicinski (13):
> >   net: netlink: add helper to retrieve NETLINK_F_STRICT_CHK
> >   rtnetlink: stats: validate attributes in get as well as dumps
> >   rtnetlink: stats: reject requests for unknown stats
> >   rtnetlink: ifinfo: perform strict checks also for doit handler
> >   net: ipv4: perform strict checks also for doit handlers
> >   net: namespace: perform strict checks also for doit handlers
> >   net: ipv4: ipmr: perform strict checks also for doit handlers
> >   net: ipv6: addr: perform strict checks also for doit handlers
> >   net: ipv6: netconf: perform strict checks also for doit handlers
> >   net: ipv6: addrlabel: perform strict checks also for doit handlers
> >   net: ipv6: route: perform strict checks also for doit handlers
> >   net: mpls: route: perform strict checks also for doit handlers
> >   net: mpls: netconf: perform strict checks also for doit handlers  
> 
> Thanks for working on this. Besides the few nits, all of the changes
> look good to me.

Thanks for those, will fix!

> Looking at RTM_GET handlers I noticed inet_rtm_getroute and
> rtnl_net_getid are not included in this set. Any reason?

I must have misread doit-only as dumpit-only.  Will add.