From: David Howells <dhowells@redhat.com>
To: Simon Horman <simon.horman@corigine.com>
Cc: dhowells@redhat.com, netdev@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
Chuck Lever <chuck.lever@oracle.com>,
Boris Pismenny <borisp@nvidia.com>,
John Fastabend <john.fastabend@gmail.com>,
Jakub Kicinski <kuba@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
David Ahern <dsahern@kernel.org>,
Matthew Wilcox <willy@infradead.org>,
Jens Axboe <axboe@kernel.dk>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v4 03/11] splice, net: Use sendmsg(MSG_SPLICE_PAGES) rather than ->sendpage()
Date: Mon, 05 Jun 2023 16:10:57 +0100 [thread overview]
Message-ID: <1729074.1685977857@warthog.procyon.org.uk> (raw)
In-Reply-To: <ZH32Jp1Iop8FaDtC@corigine.com>
Simon Horman <simon.horman@corigine.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
next prev parent reply other threads:[~2023-06-05 15:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-05 12:45 [PATCH net-next v4 00/11] splice, net: Rewrite splice-to-socket, fix SPLICE_F_MORE and handle MSG_SPLICE_PAGES in AF_TLS David Howells
2023-06-05 12:45 ` [PATCH net-next v4 01/11] net: Block MSG_SENDPAGE_* from being passed to sendmsg() by userspace David Howells
2023-06-05 12:45 ` [PATCH net-next v4 02/11] tls: Allow MSG_SPLICE_PAGES but treat it as normal sendmsg David Howells
2023-06-05 12:45 ` [PATCH net-next v4 03/11] splice, net: Use sendmsg(MSG_SPLICE_PAGES) rather than ->sendpage() David Howells
2023-06-05 14:50 ` Simon Horman
2023-06-05 15:10 ` David Howells [this message]
2023-06-05 15:18 ` Simon Horman
2023-06-05 12:45 ` [PATCH net-next v4 04/11] splice, net: Add a splice_eof op to file-ops and socket-ops David Howells
2023-06-05 12:45 ` [PATCH net-next v4 05/11] tls/sw: Use splice_eof() to flush David Howells
2023-06-05 12:45 ` [PATCH net-next v4 06/11] tls/device: " David Howells
2023-06-05 12:45 ` [PATCH net-next v4 07/11] splice, net: Fix SPLICE_F_MORE signalling in splice_direct_to_actor() David Howells
2023-06-05 12:45 ` [PATCH net-next v4 08/11] tls/sw: Support MSG_SPLICE_PAGES David Howells
2023-06-05 12:45 ` [PATCH net-next v4 09/11] tls/sw: Convert tls_sw_sendpage() to use MSG_SPLICE_PAGES David Howells
2023-06-05 12:45 ` [PATCH net-next v4 10/11] tls/device: Support MSG_SPLICE_PAGES David Howells
2023-06-05 12:46 ` [PATCH net-next v4 11/11] tls/device: Convert tls_device_sendpage() to use MSG_SPLICE_PAGES David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1729074.1685977857@warthog.procyon.org.uk \
--to=dhowells@redhat.com \
--cc=axboe@kernel.dk \
--cc=borisp@nvidia.com \
--cc=chuck.lever@oracle.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=simon.horman@corigine.com \
--cc=torvalds@linux-foundation.org \
--cc=willemdebruijn.kernel@gmail.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).