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: <6880e365b84d2_334c6729452@willemb.c.googlers.com.notmuch>
Date: Wed, 23 Jul 2025 09:28:05 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Pengtao He <hept.hept.hept@...il.com>, 
 "David S. Miller" <davem@...emloft.net>, 
 Eric Dumazet <edumazet@...gle.com>, 
 Jakub Kicinski <kuba@...nel.org>, 
 Paolo Abeni <pabeni@...hat.com>, 
 Simon Horman <horms@...nel.org>, 
 Willem de Bruijn <willemb@...gle.com>, 
 Mina Almasry <almasrymina@...gle.com>, 
 Jason Xing <kerneljasonxing@...il.com>, 
 Michal Luczaj <mhal@...x.co>, 
 Eric Biggers <ebiggers@...gle.com>, 
 Alexander Lobakin <aleksander.lobakin@...el.com>
Cc: netdev@...r.kernel.org, 
 linux-kernel@...r.kernel.org, 
 Pengtao He <hept.hept.hept@...il.com>
Subject: Re: [PATCH] net/core: fix wrong return value in __splice_segment

Pengtao He wrote:
> Return true immediately when the last segment is processed,
> without waiting for the next segment.

This can use a bit more explanation. Which unnecessary wait is
avoided.

The boolean return from __skb_splice_bits has a bit odd semantics. But
is ignored by its only caller anyway.

The relevant __splice_segment that can cause an early return is in the
frags loop. But I see no waiting operation in here.

Aside from that, the commit also should target [PATCH net-next],
assuuming that this is an optimization, not a fix.

> 
> Signed-off-by: Pengtao He <hept.hept.hept@...il.com>
> ---
>  net/core/skbuff.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index ee0274417948..cc3339ab829a 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -3114,6 +3114,9 @@ static bool __splice_segment(struct page *page, unsigned int poff,
>  		*len -= flen;
>  	} while (*len && plen);
>  
> +	if (!*len)
> +		return true;
> +
>  	return false;
>  }
>  
> -- 
> 2.49.0
> 



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ