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: <5dfc336e-d7e0-4219-af1e-6284facbdd94@uliege.be>
Date: Tue, 19 Nov 2024 14:07:11 +0100
From: Justin Iurman <justin.iurman@...ege.be>
To: Paolo Abeni <pabeni@...hat.com>, netdev@...r.kernel.org
Cc: davem@...emloft.net, dsahern@...nel.org, edumazet@...gle.com,
 kuba@...nel.org, horms@...nel.org, linux-kernel@...r.kernel.org,
 David Lebrun <dlebrun@...gle.com>
Subject: Re: [PATCH net-next v4 3/4] net: ipv6: seg6_iptunnel: mitigate
 2-realloc issue

On 11/19/24 11:47, Paolo Abeni wrote:
> On 11/18/24 14:15, Justin Iurman wrote:
> [...]
>>   /* encapsulate an IPv6 packet within an outer IPv6 header with reduced SRH */
>>   static int seg6_do_srh_encap_red(struct sk_buff *skb,
>> -				 struct ipv6_sr_hdr *osrh, int proto)
>> +				 struct ipv6_sr_hdr *osrh, int proto,
>> +				 struct dst_entry *dst)
>>   {
>>   	__u8 first_seg = osrh->first_segment;
>> -	struct dst_entry *dst = skb_dst(skb);
>> -	struct net *net = dev_net(dst->dev);
>> +	struct net *net = dev_net(skb_dst(skb)->dev);
>>   	struct ipv6hdr *hdr, *inner_hdr;
>>   	int hdrlen = ipv6_optlen(osrh);
>>   	int red_tlv_offset, tlv_offset;
> 
> 
> Minor nit: please respect the reverse x-mas tree order above.

Oopsie, forgot to move the old one on top. Will do, thanks!

> Also the code would probably be more readable with:
> 
> 	struct dst_entry *old_dst = skb_dst(skb);
> 
> and using 'old_dst' instead of 'skb_dst(skb)'

Ack. How about "dst" instead of "old_dst" (since it's the current 
dst_entry), and "cache_dst" instead of "dst"?

> Cheers,
> 
> Paolo
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ