[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFj5m9LN80E3xyNY+3nGjncr8WauoUi4QUKEX-vtmGfHrzE48A@mail.gmail.com>
Date: Mon, 29 Sep 2025 13:14:13 +0800
From: Ming Lei <ming.lei@...hat.com>
To: Li Chen <me@...ux.beauty>
Cc: Jens Axboe <axboe@...nel.dk>, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, Ming Lei <ming.lei@...hat.com>
Subject: Re: [PATCH] loop: fix backing file reference leak on validation error
On Fri, Sep 26, 2025 at 8:13 PM Li Chen <me@...ux.beauty> wrote:
>
> loop_change_fd() and loop_configure() call loop_check_backing_file()
> to validate the new backing file. If validation fails, the reference
> acquired by fget() was not dropped, leaking a file reference.
>
> Fix this by calling fput(file) before returning the error.
>
> Signed-off-by: Li Chen <chenl311@...natelecom.cn>
Good catch:
Fixes: f5c84eff634b ("loop: Add sanity check for read/write_iter")
Reviewed-by: Ming Lei <ming.lei@...hat.com>
Thanks,
Powered by blists - more mailing lists