Wojciech Lukowicz ac48787f58 io_uring: fix memory leak when removing provided buffers
[ Upstream commit b4a72c0589fdea6259720375426179888969d6a2 ]

When removing provided buffers, io_buffer structs are not being disposed
of, leading to a memory leak. They can't be freed individually, because
they are allocated in page-sized groups. They need to be added to some
free list instead, such as io_buffers_cache. All callers already hold
the lock protecting it, apart from when destroying buffers, so had to
extend the lock there.

Fixes: cc3cec8367cb ("io_uring: speedup provided buffer handling")
Signed-off-by: Wojciech Lukowicz <wlukowicz01@gmail.com>
Link: https://lore.kernel.org/r/20230401195039.404909-2-wlukowicz01@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-04-13 16:55:31 +02:00
..
2022-08-12 17:01:00 -06:00
2022-09-21 13:15:02 -06:00
2022-07-24 18:39:11 -06:00
2022-07-24 18:39:14 -06:00
2022-10-07 12:25:30 -06:00
2022-09-01 17:39:05 -04:00