diff options
author | Li Chen <me@linux.beauty> | 2025-09-30 08:35:59 +0800 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2025-10-02 15:25:47 -0600 |
commit | 98b7bf54338b797e3a11e8178ce0e806060d8fa3 (patch) | |
tree | 39a4809bdaf663c1ad27b17a41a561c595a8dbff /rust/helpers/pci.c | |
parent | e1b1d03ceec343362524318c076b110066ffe305 (diff) |
loop: fix backing file reference leak on validation error
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.
Cc: stable@vger.kernel.org
Cc: Markus Elfring <Markus.Elfring@web.de>
CC: Yang Erkun <yangerkun@huawei.com>
Cc: Ming Lei <ming.lei@redhat.com>
Cc: Yu Kuai <yukuai1@huaweicloud.com>
Fixes: f5c84eff634b ("loop: Add sanity check for read/write_iter")
Signed-off-by: Li Chen <chenl311@chinatelecom.cn>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Yang Erkun <yangerkun@huawei.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'rust/helpers/pci.c')
0 files changed, 0 insertions, 0 deletions