Re: [PATCH] io_uring: fix file leak on creating io ctx

2020-12-08 Thread Jens Axboe
On 12/8/20 3:28 AM, Hillf Danton wrote: > On Mon, 7 Dec 2020 09:42:21 -0700 Jens Axboe wrote: >> On 12/7/20 1:15 AM, Hillf Danton wrote: >>> @@ -9207,12 +9208,14 @@ err_fd: >>> #if defined(CONFIG_UNIX) >>> ctx->ring_sock->file = file; >>> #endif >>> - if (unlikely(io_uring_add_task_file(ctx

Re: [PATCH] io_uring: fix file leak on creating io ctx

2020-12-07 Thread Jens Axboe
On 12/7/20 1:15 AM, Hillf Danton wrote: > @@ -9207,12 +9208,14 @@ err_fd: > #if defined(CONFIG_UNIX) > ctx->ring_sock->file = file; > #endif > - if (unlikely(io_uring_add_task_file(ctx, file))) { > - file = ERR_PTR(-ENOMEM); > - goto err_fd; > + ret = io_urin

Re: [PATCH] io_uring: fix file leak on creating io ctx

2020-12-07 Thread Jens Axboe
On 12/7/20 8:04 AM, Jens Axboe wrote: > On 12/7/20 1:15 AM, Hillf Danton wrote: >> Put file as part of error handling when setting up io ctx to fix >> memory leak like the following one. >> >>BUG: memory leak >>unreferenced object 0x888101ea2200 (size 256): >> comm "syz-executor355

Re: [PATCH] io_uring: fix file leak on creating io ctx

2020-12-07 Thread Jens Axboe
On 12/7/20 1:15 AM, Hillf Danton wrote: > Put file as part of error handling when setting up io ctx to fix > memory leak like the following one. > >BUG: memory leak >unreferenced object 0x888101ea2200 (size 256): > comm "syz-executor355", pid 8470, jiffies 4294953658 (age 32.400s)