[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZH3841Qotr/QWgXk@corigine.com>
Date: Mon, 5 Jun 2023 17:18:59 +0200
From: Simon Horman <simon.horman@...igine.com>
To: David Howells <dhowells@...hat.com>
Cc: netdev@...r.kernel.org, Linus Torvalds <torvalds@...ux-foundation.org>,
	Chuck Lever <chuck.lever@...cle.com>,
	Boris Pismenny <borisp@...dia.com>,
	John Fastabend <john.fastabend@...il.com>,
	Jakub Kicinski <kuba@...nel.org>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
	Willem de Bruijn <willemdebruijn.kernel@...il.com>,
	David Ahern <dsahern@...nel.org>,
	Matthew Wilcox <willy@...radead.org>, Jens Axboe <axboe@...nel.dk>,
	linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH net-next v4 03/11] splice, net: Use
 sendmsg(MSG_SPLICE_PAGES) rather than ->sendpage()
On Mon, Jun 05, 2023 at 04:10:57PM +0100, David Howells wrote:
> Simon Horman <simon.horman@...igine.com> wrote:
> 
> > I'm assuming the answer is that this cannot occur,
> > but I thought I should mention this anyway.
> > 
> > If the initial value of len is 0 (or less).
> > ...
> > > +	return spliced ?: ret;
> > 
> > Then ret will be used uninitialised here.
> 
> len shouldn't be <0 as it's size_t.
Yes, sorry for not noticing that.
> I don't think it should be possible to get there with len==0 - at least from
> userspace.  sys_splice() returns immediately and sys_sendfile() either splices
> to a pipe or goes via splice_direct_to_actor() will just drop straight out.
> But there are kernel users - nfsd for example - but I don't know if they would
> splice directly to a socket.
> 
> That said, it's probably worth preclearing ret just to be sure.
Thanks, I agree it's better to be safe than sorry.
Powered by blists - more mailing lists