Zhihao Cheng
5ff2514e4f
ubi: ubi_create_volume: Fix use-after-free when volume creation failed
...
[ Upstream commit 8c03a1c21d72210f81cb369cc528e3fde4b45411 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-06-14 18:36:10 +02:00
..
2022-06-09 10:23:25 +02:00
2022-04-08 14:23:29 +02:00
2022-01-27 11:03:15 +01:00
2022-01-20 09:13:16 +01:00
2022-06-09 10:22:51 +02:00
2022-02-23 12:03:16 +01:00
2022-06-09 10:22:51 +02:00
2021-05-10 12:48:35 +02:00
2022-06-14 18:36:10 +02:00
2021-08-23 10:01:04 +02:00
2021-03-11 09:37:48 +01:00
2021-06-11 20:44:21 +02:00
2021-08-06 22:05:13 +02:00
2021-09-05 10:50:12 -07:00
2021-08-17 18:41:59 +02:00
2022-06-09 10:22:49 +02:00
2021-03-28 19:24:54 +02:00
2021-08-17 18:43:33 +02:00
2022-03-02 11:48:07 +01:00
2021-06-11 20:43:46 +02:00
2022-01-27 11:02:48 +01:00
2021-06-16 21:09:31 -07:00
2020-12-01 14:53:39 -07:00
2021-03-11 09:37:48 +01:00
2021-05-10 12:11:46 +02:00
2021-06-11 20:43:26 +02:00
2021-08-23 10:01:06 +02:00
2021-05-10 12:49:00 +02:00