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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <10327c0a-acf8-4aa5-a994-3049a7cb5abd@6wind.com>
Date: Mon, 8 Jul 2024 20:15:05 +0200
From: Nicolas Dichtel <nicolas.dichtel@...nd.com>
To: David Ahern <dsahern@...nel.org>, "David S . Miller"
 <davem@...emloft.net>, Jakub Kicinski <kuba@...nel.org>,
 Paolo Abeni <pabeni@...hat.com>, Eric Dumazet <edumazet@...gle.com>
Cc: netdev@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH net v2 2/4] ipv6: fix source address selection with route
 leak

Le 07/07/2024 à 18:58, David Ahern a écrit :
> On 7/5/24 8:52 AM, Nicolas Dichtel wrote:
>> diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
>> index a18ed24fed94..a7c27f0c6bce 100644
>> --- a/include/net/ip6_route.h
>> +++ b/include/net/ip6_route.h
>> @@ -127,18 +127,23 @@ void rt6_age_exceptions(struct fib6_info *f6i, struct fib6_gc_args *gc_args,
>>  
>>  static inline int ip6_route_get_saddr(struct net *net, struct fib6_info *f6i,
>>  				      const struct in6_addr *daddr,
>> -				      unsigned int prefs,
>> +				      unsigned int prefs, int l3mdev_index,
>>  				      struct in6_addr *saddr)
>>  {
>> +	struct net_device *l3mdev;
>> +	struct net_device *dev;
>> +	bool same_vrf;
>>  	int err = 0;
>>  
>> -	if (f6i && f6i->fib6_prefsrc.plen) {
>> +	rcu_read_lock();
>> +	l3mdev = dev_get_by_index_rcu(net, l3mdev_index);
>> +	dev = f6i ? fib6_info_nh_dev(f6i) : NULL;
>> +	same_vrf = l3mdev == NULL || l3mdev_master_dev_rcu(dev) == l3mdev;
> 
> !l3mdev; checkpatch should complain
No. I was unaware of this preference, is there a rule written somewhere about this?

$ git grep '(![a-zA-Z])' net/ipv6/ | wc -l
43
$ git grep '== NULL' net/ipv6/ | wc -l
44

It seems both are used.


Regards,
Nicolas

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ