History

io_uring: fix a memory leak of buffer group list on exit

If we use a buffer group ID that is large enough to require io_uring to allocate it, then we don't correctly free it if the cleanup is deferred to the ring exit. The explicit removal paths are fine.

Jens Axboe committed 4 years ago

Commit 21870e01 parent 1151a7c1 file · +1 −0Browse files

Unified · Split

fs/io_uring.c+1−0
@@ -11065,6 +11065,7 @@ static void io_destroy_buffers(struct io_ring_ctx *ctx) · 11064 unmodified lines
1106511065 xa_for_each(&ctx->io_bl_xa, index, bl) {
1106611066 xa_erase(&ctx->io_bl_xa, bl->bgid);
1106711067 __io_remove_buffers(ctx, bl, -1U);
11068+ kfree(bl);
1106811069 }
1106911070
1107011071 while (!list_empty(&ctx->io_buffers_pages)) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t