From: Jens Axboe <axboe@kernel.dk>
To: Jann Horn <jannh@google.com>
Cc: io-uring@vger.kernel.org
Subject: Re: [PATCHSET RFC 0/3] Add support for ring resizing
Date: Thu, 24 Oct 2024 10:05:26 -0600 [thread overview]
Message-ID: <b97a3a10-44e5-4158-b2c1-70c07d5fb5d7@kernel.dk> (raw)
In-Reply-To: <CAG48ez2OMzMddB1-oCgKOgez4jUGb7E+aiku_c5f5nwZeuwJ3Q@mail.gmail.com>
On 10/24/24 9:47 AM, Jann Horn wrote:
> On Tue, Oct 22, 2024 at 4:08 AM Jens Axboe <axboe@kernel.dk> wrote:
>> Here's a stab at supporting ring resizing. It supports resizing of
>> both rings, SQ and CQ, as it's really no different than just doing
>> the CQ ring itself. liburing has a 'resize-rings' branch with a bit
>> of support code, and a test case:
>>
>> https://git.kernel.dk/cgit/liburing/log/?h=resize-rings
>>
>> and these patches can also be found here:
>>
>> https://git.kernel.dk/cgit/linux/log/?h=io_uring-ring-resize
>
> You'd need to properly synchronize that path with io_uring_mmap(),
> right? Take a lock that prevents concurrent mmap() from accessing
> ctx->ring_pages while the resize is concurrently freeing that array,
> so that you don't get UAF?
Yep indeed! It's missing the mmap_lock, I'll add that.
> And I guess ideally you'd also zap the already-mapped pages from
> corresponding VMAs with something like unmap_mapping_range(), though
> that won't make a difference security-wise since the pages are
> refcounted by the userspace mapping anyway.
Yes don't think we need to do anything there, just have userspace
unmap the old range upon return.
--
Jens Axboe
prev parent reply other threads:[~2024-10-24 16:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-22 2:08 [PATCHSET RFC 0/3] Add support for ring resizing Jens Axboe
2024-10-22 2:08 ` [PATCH 1/3] io_uring: move max entry definition and ring sizing into header Jens Axboe
2024-10-22 2:08 ` [PATCH 2/3] io_uring: abstract out a bit of the ring filling logic Jens Axboe
2024-10-22 2:08 ` [PATCH 3/3] io_uring/register: add IORING_REGISTER_RESIZE_RINGS Jens Axboe
2024-10-24 15:47 ` [PATCHSET RFC 0/3] Add support for ring resizing Jann Horn
2024-10-24 16:05 ` Jens Axboe [this message]
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=b97a3a10-44e5-4158-b2c1-70c07d5fb5d7@kernel.dk \
--to=axboe@kernel.dk \
--cc=io-uring@vger.kernel.org \
--cc=jannh@google.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.