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: <686a887a34d5a_3ad0f3294c@willemb.c.googlers.com.notmuch>
Date: Sun, 06 Jul 2025 10:30:18 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Cong Wang <xiyou.wangcong@...il.com>, 
 Fengyuan Gong <gfengyuan@...gle.com>
Cc: Jakub Kicinski <kuba@...nel.org>, 
 Paolo Abeni <pabeni@...hat.com>, 
 Simon Horman <horms@...nel.org>, 
 toke@...e.dk, 
 edumazet@...gle.com, 
 "David S . Miller" <davem@...emloft.net>, 
 Jamal Hadi Salim <jhs@...atatu.com>, 
 Jiri Pirko <jiri@...nulli.us>, 
 Stanislav Fomichev <sdf@...ichev.me>, 
 Kuniyuki Iwashima <kuniyu@...gle.com>, 
 Ahmed Zaki <ahmed.zaki@...el.com>, 
 Alexander Lobakin <aleksander.lobakin@...el.com>, 
 netdev@...r.kernel.org, 
 linux-kernel@...r.kernel.org, 
 cake@...ts.bufferbloat.net, 
 willemb@...gle.com
Subject: Re: [PATCH net-next] net: account for encap headers in qdisc pkt len

Cong Wang wrote:
> On Wed, Jul 02, 2025 at 04:07:41PM +0000, Fengyuan Gong wrote:
> > diff --git a/net/core/dev.c b/net/core/dev.c
> > index 11da1e272ec20..dfec541f68e3a 100644
> > --- a/net/core/dev.c
> > +++ b/net/core/dev.c
> > @@ -3944,7 +3944,10 @@ static void qdisc_pkt_len_init(struct sk_buff *skb)
> >  		unsigned int hdr_len;
> >  
> >  		/* mac layer + network layer */
> > -		hdr_len = skb_transport_offset(skb);
> > +		if (!skb->encapsulation)
> > +			hdr_len = skb_transport_offset(skb);
> > +		else
> > +			hdr_len = skb_inner_transport_offset(skb);
> 
> This pattern seems repeated in a few places, other than the two you are
> patching, I saw another one:
> 
> 2465 static netdev_features_t hns3_features_check(struct sk_buff *skb,
> 2466                                              struct net_device *dev,
> 2467                                              netdev_features_t features)
> 2468 {
> 2469 #define HNS3_MAX_HDR_LEN        480U
> 2470 #define HNS3_MAX_L4_HDR_LEN     60U
> 2471 
> 2472         size_t len;
> 2473 
> 2474         if (skb->ip_summed != CHECKSUM_PARTIAL)
> 2475                 return features;
> 2476 
> 2477         if (skb->encapsulation)
> 2478                 len = skb_inner_transport_offset(skb);
> 2479         else
> 2480                 len = skb_transport_offset(skb);

>From a quick grep, this is the only other case, right?
 
> Maybe worth a helper now?

If only one more, I wouldn't respin for that.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ