]> www.infradead.org Git - users/jedix/linux-maple.git/commit
io_uring: fix potential page leak in io_sqe_buffer_register()
authorPenglei Jiang <superman.xpt@gmail.com>
Tue, 17 Jun 2025 16:56:44 +0000 (09:56 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 18 Jun 2025 11:09:46 +0000 (05:09 -0600)
commite1c75831f682eef0f68b35723437146ed86070b1
tree9e3b2a18e84b0d31358c50a17977d00de2be285f
parentf2320f1dd6f6f82cb2c7aff23a12bab537bdea89
io_uring: fix potential page leak in io_sqe_buffer_register()

If allocation of the 'imu' fails, then the existing pages aren't
unpinned in the error path. This is mostly a theoretical issue,
requiring fault injection to hit.

Move unpin_user_pages() to unified error handling to fix the page leak
issue.

Fixes: d8c2237d0aa9 ("io_uring: add io_pin_pages() helper")
Signed-off-by: Penglei Jiang <superman.xpt@gmail.com>
Link: https://lore.kernel.org/r/20250617165644.79165-1-superman.xpt@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/rsrc.c