summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2026-10-08 13:07:38 -0600
committerJens Axboe <axboe@kernel.dk>2026-10-09 08:20:41 -0600
commitcde56daf4b93f474dc256dbcc5205035223ae6f5 (patch)
tree26080bca928a985c1fa634edff765e481ea3e40e
parentb59cabf9b4acb65f3f9968087ca0e18010d85076 (diff)
downloadlinux-cde56daf4b93f474dc256dbcc5205035223ae6f5.tar.gz
linux-cde56daf4b93f474dc256dbcc5205035223ae6f5.zip
io_uring/kbuf: don't charge provided buffer rings to RLIMIT_MEMLOCK
Just like with the SQ and CQ rings, the provided buffer rings were also not charged against the memlock limit prior to the below mentioned commit. Restore that behavior. Fixes: ef62de3c4ad5 ("io_uring/kbuf: use region api for pbuf rings") Reported-by: Hengyu Liang <hengyul@cs.unc.edu> Cc: stable@vger.kernel.org Tested-by: Hengyu Liang <hengyul@cs.unc.edu> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--io_uring/kbuf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c
index 7c59ab9cfc8b..6e2facf34bfa 100644
--- a/io_uring/kbuf.c
+++ b/io_uring/kbuf.c
@@ -459,7 +459,7 @@ static int io_remove_buffers_legacy(struct io_ring_ctx *ctx,
static void io_put_bl(struct io_ring_ctx *ctx, struct io_buffer_list *bl)
{
if (bl->flags & IOBL_BUF_RING)
- io_free_region(ctx->user, &bl->region);
+ io_free_region(NULL, &bl->region);
else
io_remove_buffers_legacy(ctx, bl, -1U);
@@ -676,7 +676,7 @@ int io_register_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg)
rd.user_addr = reg.ring_addr;
rd.flags |= IORING_MEM_REGION_TYPE_USER;
}
- ret = io_create_region(ctx->user, &bl->region, &rd, mmap_offset);
+ ret = io_create_region(NULL, &bl->region, &rd, mmap_offset);
if (ret)
goto fail;
br = io_region_get_ptr(&bl->region);
@@ -709,7 +709,7 @@ int io_register_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg)
if (!ret)
return 0;
fail:
- io_free_region(ctx->user, &bl->region);
+ io_free_region(NULL, &bl->region);
kfree(bl);
return ret;
}