Skip to content
Commit ac48787f authored by Wojciech Lukowicz's avatar Wojciech Lukowicz Committed by Greg Kroah-Hartman
Browse files

io_uring: fix memory leak when removing provided buffers

[ Upstream commit b4a72c05 ]

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: cc3cec83

 ("io_uring: speedup provided buffer handling")
Signed-off-by: default avatarWojciech Lukowicz <wlukowicz01@gmail.com>
Link: https://lore.kernel.org/r/20230401195039.404909-2-wlukowicz01@gmail.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent bd4081fa
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