[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YobPB27Ozl7uqUEu@zx2c4.com>
Date: Fri, 20 May 2022 01:13:11 +0200
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: Jens Axboe <axboe@...nel.dk>
Cc: tytso@....edu, hch@....de, linux-kernel@...r.kernel.org
Subject: Re: [PATCHSET 0/2] Fix splice from random/urandom
Hi Jens,
On Thu, May 19, 2022 at 02:49:13PM -0600, Jens Axboe wrote:
> > There's a lot of attention in random.c devoted to not leaving any output
> > around on the stack or in stray buffers. The explicit use of
> > copy_to_user() makes it clear that the output isn't being copied
> > anywhere other than what's the user's responsibility to cleanup. I'm
> > wondering if the switch to copy_to_iter() introduces any buffering or
> > gotchas that you might be aware of.
>
> No, it's just a wrapper around copying to the user memory pointed to by
> the iov_iter. No extra buffering or anything like that. So I think it
> should be fine in that respect, and it actually cleans up the code a bit
> imho since the copy_to_iter() since the return value of "bytes copied"
> is easier to work with than the "bytes not copied".
Alright, that's good to hear. So even for kernel->kernel writes, the
argument is that what ever buffers are used in the process are the same
ones that the user would be hitting anyway by calling write() on the
destination if this roundtripped through userspace, so nothing changes?
Jason
Powered by blists - more mailing lists