Skip to content
Commit 712e2c84 authored by Gabriel Krisman Bertazi's avatar Gabriel Krisman Bertazi Committed by Sasha Levin
Browse files

io_uring: Fix release of pinned pages when __io_uaddr_map fails

[ Upstream commit 67d1189d

 ]

Looking at the error path of __io_uaddr_map, if we fail after pinning
the pages for any reasons, ret will be set to -EINVAL and the error
handler won't properly release the pinned pages.

I didn't manage to trigger it without forcing a failure, but it can
happen in real life when memory is heavily fragmented.

Signed-off-by: default avatarGabriel Krisman Bertazi <krisman@suse.de>
Fixes: 223ef474

 ("io_uring: don't allow IORING_SETUP_NO_MMAP rings on highmem pages")
Link: https://lore.kernel.org/r/20240313213912.1920-1-krisman@suse.de
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 25cc5521
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment