[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240415210827.GX2118490@ZenIV>
Date: Mon, 15 Apr 2024 22:08:27 +0100
From: Al Viro <viro@...iv.linux.org.uk>
To: Jens Axboe <axboe@...nel.dk>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH 002/437] fs: add generic read/write iterator helpers
On Mon, Apr 15, 2024 at 02:11:56PM -0600, Jens Axboe wrote:
> do_loop_{readv,writev} need to look like the one io_uring had, which was
> just an augmented version of the fs/ version. At least for handling
> anything that is IOVEC/UBUF/BVEC.
IOVEC and UBUF: pointer will be __user one; copy_from_user() works.
KVEC: kernel pointer. Try copy_from_user() on that on x86 with SMAP (or
on e.g. sparc64, etc.) and you'll get an oops.
BVEC: page + offset, page quite possibly not mapped anywhere in kernel page
tables. And "just kmap() around the call of your callback" is not a good
idea either, for even more reason that for KVEC.
Powered by blists - more mailing lists