]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
io_uring: fix personality idr leak
authorJens Axboe <axboe@kernel.dk>
Sun, 23 Feb 2020 20:11:42 +0000 (13:11 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 24 Feb 2020 15:31:51 +0000 (08:31 -0700)
We somehow never free the idr, even though we init it for every ctx.
Free it when the rest of the ring data is freed.

Fixes: 071698e13ac6 ("io_uring: allow registering credentials")
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c

index 7d0be264527d60b77f82d8237ff743a3a68c5393..d961945cb332087a2e9760b34cab676de489a483 100644 (file)
@@ -6339,6 +6339,7 @@ static void io_ring_ctx_free(struct io_ring_ctx *ctx)
        io_sqe_buffer_unregister(ctx);
        io_sqe_files_unregister(ctx);
        io_eventfd_unregister(ctx);
+       idr_destroy(&ctx->personality_idr);
 
 #if defined(CONFIG_UNIX)
        if (ctx->ring_sock) {