lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 7 Jul 2021 17:38:53 +0300
From:   Alexander Mikhalitsyn <alexander.mikhalitsyn@...tuozzo.com>
To:     Stephen Hemminger <stephen@...workplumber.org>
Cc:     netdev@...r.kernel.org,
        Alexander Mikhalitsyn <alexander@...alicyn.com>
Subject: Re: [PATCHv5 iproute2] ip route: ignore ENOENT during save if
 RT_TABLE_MAIN is being dumped

On Wed, 7 Jul 2021 07:35:05 -0700
Stephen Hemminger <stephen@...workplumber.org> wrote:

> On Wed,  7 Jul 2021 15:22:01 +0300
> Alexander Mikhalitsyn <alexander.mikhalitsyn@...tuozzo.com> wrote:
> 
> > We started to use in-kernel filtering feature which allows to get only
> > needed tables (see iproute_dump_filter()). From the kernel side it's
> > implemented in net/ipv4/fib_frontend.c (inet_dump_fib), net/ipv6/ip6_fib.c
> > (inet6_dump_fib). The problem here is that behaviour of "ip route save"
> > was changed after
> > c7e6371bc ("ip route: Add protocol, table id and device to dump request").
> > If filters are used, then kernel returns ENOENT error if requested table
> > is absent, but in newly created net namespace even RT_TABLE_MAIN table
> > doesn't exist. It is really allocated, for instance, after issuing
> > "ip l set lo up".
> > 
> > Reproducer is fairly simple:
> > $ unshare -n ip route save > dump
> > Error: ipv4: FIB table does not exist.
> > Dump terminated
> > 
> > Expected result here is to get empty dump file (as it was before this
> > change).
> > 
> > v2: reworked, so, now it takes into account NLMSGERR_ATTR_MSG
> > (see nl_dump_ext_ack_done() function). We want to suppress error messages
> > in stderr about absent FIB table from kernel too.
> > 
> > v3: reworked to make code clearer. Introduced rtnl_suppressed_errors(),
> > rtnl_suppress_error() helpers. User may suppress up to 3 errors (may be
> > easily extended by changing SUPPRESS_ERRORS_INIT macro).
> > 
> > v4: reworked, rtnl_dump_filter_errhndlr() was introduced. Thanks
> > to Stephen Hemminger for comments and suggestions
> > 
> > v5: space fixes, commit message reformat, empty initializers
> > 
> > Fixes: c7e6371bc ("ip route: Add protocol, table id and device to dump request")
> > Cc: David Ahern <dsahern@...il.com>
> > Cc: Stephen Hemminger <stephen@...workplumber.org>
> > Cc: Andrei Vagin <avagin@...il.com>
> > Cc: Alexander Mikhalitsyn <alexander@...alicyn.com>
> > Signed-off-by: Alexander Mikhalitsyn <alexander.mikhalitsyn@...tuozzo.com>
> 
> Applied this version

Stephen,

Thank you for your review and suggestions!

Alex

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ