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: <b75dd859-266e-16d7-f37a-1c349fccacd4@nvidia.com>
Date:   Sun, 28 Nov 2021 22:14:12 +0200
From:   Nikolay Aleksandrov <nikolay@...dia.com>
To:     David Ahern <dsahern@...il.com>,
        Nikolay Aleksandrov <razor@...ckwall.org>,
        netdev@...r.kernel.org
Cc:     idosch@...sch.org, davem@...emloft.net, kuba@...nel.org
Subject: Re: [PATCH net v2 1/3] net: ipv6: add fib6_nh_release_dsts stub

On 28/11/2021 21:21, David Ahern wrote:
> On 11/22/21 8:15 AM, Nikolay Aleksandrov wrote:
>> diff --git a/net/ipv6/route.c b/net/ipv6/route.c
>> index 3ae25b8ffbd6..42d60c76d30a 100644
>> --- a/net/ipv6/route.c
>> +++ b/net/ipv6/route.c
>> @@ -3680,6 +3680,25 @@ void fib6_nh_release(struct fib6_nh *fib6_nh)
>>  	fib_nh_common_release(&fib6_nh->nh_common);
>>  }
>>  
>> +void fib6_nh_release_dsts(struct fib6_nh *fib6_nh)
>> +{
>> +	int cpu;
>> +
>> +	if (!fib6_nh->rt6i_pcpu)
>> +		return;
>> +
>> +	for_each_possible_cpu(cpu) {
>> +		struct rt6_info *pcpu_rt, **ppcpu_rt;
>> +
>> +		ppcpu_rt = per_cpu_ptr(fib6_nh->rt6i_pcpu, cpu);
>> +		pcpu_rt = xchg(ppcpu_rt, NULL);
>> +		if (pcpu_rt) {
>> +			dst_dev_put(&pcpu_rt->dst);
>> +			dst_release(&pcpu_rt->dst);
>> +		}
>> +	}
>> +}
>> +
> 
> this duplicates fib6_nh_release. Can you send a follow on to have it use
> this new function?
> 

It duplicates a part of it but in a safe way because the fib6_nh could still be visible,
while fib6_nh_release does it in a way that assumes it's not. I could re-use
this helper in fib6_nh_release though, since it doesn't matter how the entries are
freed there. I'm guessing that is what you meant?
I'll take care of that and of the few possible optimizations for nexthop in net-next.

Thanks,
 Nik
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ