Re: [PATCH] io_uring: fix cloned compound buffer accounting and R_DISABLED restriction bypass
From: Jens Axboe
Date: Mon Sep 21 2026 - 13:17:06 EST
On 9/19/26 4:17 PM, Hui Peng wrote:
> Fix two issues in io_uring buffer registration and restriction
> enforcement:
>
> 1. In io_uring/rsrc.c, when registered compound buffers are cloned
> across rings via IORING_REGISTER_BUFFERS2 /
> IORING_RSRC_REGISTER_SPARSE, unaccounting on release can underflow
> mm->pinned_vm and user->locked_vm if head pages are unaccounted
> multiple times or against a different accounting context. Track per-
> imu accounting ownership cleanly.
> 2. In io_uring/register.c, enforce IO_RING_F_REG_RESTRICTED on rings
> created with IORING_SETUP_R_DISABLED so restricted opcodes cannot be
> invoked before restrictions are registered and enabled.
>
> Fixes: 735729844819 ("io_uring: move rsrc related data, core, and commands")
> Fixes: c43203154d8a ("io_uring/register: move io_uring_register(2) related code to register.c")
Sad to say, but this is mostly a pile of garbage. It breaks the current
and documented use case of how to use IORING_SETUP_R_DISABLED, and if you
had run the test suite, you would already know that.
And the two commits you reference? Did you even look at them, they are
just moving code around.
Two suggestions for you:
1) Don't send patches for things you don't understand
2) Upgrade to a better LLM, the one you are using is garbage
--
Jens Axboe