diff options
author | Zhihao Cheng <chengzhihao1@huawei.com> | 2022-05-10 15:31:26 +0300 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2022-05-27 17:49:41 +0300 |
commit | 8c03a1c21d72210f81cb369cc528e3fde4b45411 (patch) | |
tree | 3522098526b91e0b24e51fa36ed869ba64939b4f /fs/jffs2/fs.c | |
parent | 14072ee33d5a2a07d735b667205f99d0a95de9f2 (diff) | |
download | linux-8c03a1c21d72210f81cb369cc528e3fde4b45411.tar.xz |
ubi: ubi_create_volume: Fix use-after-free when volume creation failed
There is an use-after-free problem for 'eba_tbl' in ubi_create_volume()'s
error handling path:
ubi_eba_replace_table(vol, eba_tbl)
vol->eba_tbl = tbl
out_mapping:
ubi_eba_destroy_table(eba_tbl) // Free 'eba_tbl'
out_unlock:
put_device(&vol->dev)
vol_release
kfree(tbl->entries) // UAF
Fix it by removing redundant 'eba_tbl' releasing.
Fetch a reproducer in [Link].
Fixes: 493cfaeaa0c9b ("mtd: utilize new cdev_device_add helper function")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=215965
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'fs/jffs2/fs.c')
0 files changed, 0 insertions, 0 deletions