public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring: fix personality idr leak
@ 2020-02-23 21:17 Jens Axboe
  2020-02-24 10:16 ` Stefano Garzarella
  0 siblings, 1 reply; 2+ messages in thread
From: Jens Axboe @ 2020-02-23 21:17 UTC (permalink / raw)
  To: io-uring

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")
Signed-off-by: Jens Axboe <[email protected]>

---

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 7d0be264527d..d961945cb332 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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) {

-- 
Jens Axboe


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] io_uring: fix personality idr leak
  2020-02-23 21:17 [PATCH] io_uring: fix personality idr leak Jens Axboe
@ 2020-02-24 10:16 ` Stefano Garzarella
  0 siblings, 0 replies; 2+ messages in thread
From: Stefano Garzarella @ 2020-02-24 10:16 UTC (permalink / raw)
  To: Jens Axboe; +Cc: io-uring

On Sun, Feb 23, 2020 at 02:17:36PM -0700, Jens Axboe wrote:
> 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")
> Signed-off-by: Jens Axboe <[email protected]>
> 
> ---

Reviewed-by: Stefano Garzarella <[email protected]>

> 
> diff --git a/fs/io_uring.c b/fs/io_uring.c
> index 7d0be264527d..d961945cb332 100644
> --- a/fs/io_uring.c
> +++ b/fs/io_uring.c
> @@ -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) {
> 
> -- 
> Jens Axboe
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-02-24 10:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-23 21:17 [PATCH] io_uring: fix personality idr leak Jens Axboe
2020-02-24 10:16 ` Stefano Garzarella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox