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]
Message-ID: <ZLZ6ipKWo1dSW8Xc@shredder>
Date: Tue, 18 Jul 2023 14:42:02 +0300
From: Ido Schimmel <idosch@...sch.org>
To: Hangbin Liu <liuhangbin@...il.com>
Cc: netdev@...r.kernel.org, "David S . Miller" <davem@...emloft.net>,
	David Ahern <dsahern@...nel.org>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
	Thomas Haller <thaller@...hat.com>
Subject: Re: [PATCH net] ipv6: do not match device when remove source route

On Tue, Jul 18, 2023 at 02:52:53PM +0800, Hangbin Liu wrote:
> After deleting an IPv6 address on an interface and cleaning up the
> related preferred source entries, it is important to ensure that all
> routes associated with the deleted address are properly cleared. The
> current implementation of rt6_remove_prefsrc() only checks the preferred
> source addresses bound to the current device. However, there may be
> routes that are bound to other devices but still utilize the same
> preferred source address.
> 
> To address this issue, it is necessary to also delete entries that are
> bound to other interfaces but share the same source address with the
> current device. Failure to delete these entries would leave routes that
> are bound to the deleted address unclear. Here is an example reproducer
> (I have omitted unrelated routes):

[...]

> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
> index 64e873f5895f..ab8c364e323c 100644
> --- a/net/ipv6/route.c
> +++ b/net/ipv6/route.c
> @@ -4607,7 +4607,6 @@ void rt6_remove_prefsrc(struct inet6_ifaddr *ifp)
>  {
>  	struct net *net = dev_net(ifp->idev->dev);
>  	struct arg_dev_net_ip adni = {
> -		.dev = ifp->idev->dev,

Wouldn't this affect routes in different VRFs?

See commit 5a56a0b3a45d ("net: Don't delete routes in different VRFs")
and related fixes:

8a2618e14f81 ipv4: Fix incorrect table ID in IOCTL path
c0d999348e01 ipv4: Fix incorrect route flushing when table ID 0 is used
f96a3d74554d ipv4: Fix incorrect route flushing when source address is deleted
e0a312629fef ipv4: Fix table id reference in fib_sync_down_addr

Anyway, please add tests to tools/testing/selftests/net/fib_tests.sh

>  		.net = net,
>  		.addr = &ifp->addr,
>  	};
> -- 
> 2.38.1
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ