Gabriel Krisman Bertazi 4d376d7ad6 io_uring: Fix release of pinned pages when __io_uaddr_map fails
[ Upstream commit 67d1189d1095d471ed7fa426c7e384a7140a5dd7 ]

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: Gabriel Krisman Bertazi <krisman@suse.de>
Fixes: 223ef4743164 ("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: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-03-26 18:17:32 -04:00
..
2023-12-29 11:58:41 -08:00
2023-11-28 11:56:29 -07:00
2022-12-07 06:47:13 -07:00
2022-07-24 18:39:11 -06:00
2022-07-24 18:39:14 -06:00
2023-08-11 10:42:57 -06:00
2024-01-11 14:19:23 -08:00