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] [day] [month] [year] [list]
Message-ID: <psfmabpw6p3fk5jk3iuuhv4eiolmtvteiydgoxowk35jxpdslu@pcuzmfyxkm6s>
Date: Wed, 21 Feb 2024 13:50:50 -0500
From: Oliver Crumrine <ozlinuxc@...il.com>
To: dsahern@...nel.org, davem@...emloft.net, edumazet@...gle.com, 
	kuba@...nel.org, pabeni@...hat.com
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next] net: copy routing table more efficiently in
 rt_dst_clone

On Tue, Feb 20, 2024 at 07:44:24PM -0700, David Ahern wrote:
Hi David,

You are correct that rtable is a container of dst_entry, and the
previous code copied not only the fields of rtable but also the fields
of dst_entry. However, the *new_rt = *rt line not only copies the fields
of rtable, but also the fields of dst_entry. 

I have demonstrated this by generating a random number and putting it in
the "expired" field of the dst_entry that is part of rt, and the printing
the random number that was generated. After the copy, I printed the
expired field of the dst_entry that is part of new_rt and the numbers
matched. This proves that not only the fields that were part of rtable
were copied but also the fields of dst_entry.

Thanks,
Oliver
> On 2/18/24 6:35 AM, Oliver Crumrine wrote:
> > diff --git a/net/ipv4/route.c b/net/ipv4/route.c
> > index 16615d107cf0..ebb17c3a0dec 100644
> > --- a/net/ipv4/route.c
> > +++ b/net/ipv4/route.c
> > @@ -1664,22 +1664,8 @@ struct rtable *rt_dst_clone(struct net_device *dev, struct rtable *rt)
> >  			   rt->dst.flags);
> >  
> >  	if (new_rt) {
> > +		*new_rt = *rt;
> 
> rtable is a container of dst_entry, so this is copying those fields as well.
> 
> pw-bot: reject
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ