[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1729074.1685977857@warthog.procyon.org.uk>
Date: Mon, 05 Jun 2023 16:10:57 +0100
From: David Howells <dhowells@...hat.com>
To: Simon Horman <simon.horman@...igine.com>
Cc: dhowells@...hat.com, 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()
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.
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.
David
Powered by blists - more mailing lists