firmware: fix one UAF issue
PATCH 1/1 firmware: fix one UAF issue
From: Xinghui Li <[email protected]>
There could be the use after free issue in dmi_sysfs_register_handle. During handling specializations process, the entry->child could be free if the error occurs. However, it will be kobject_put after free. So, we set the entry->child to NULL to avoid above case.
Reported-by loydlv <[email protected]>
Signed-off-by Xinghui Li <[email protected]>
--- drivers/firmware/dmi-sysfs.c | 1 + 1 file changed, 1 insertion(+)
drivers/firmware/dmi-sysfs.c +1 -0
@@ -470,6 +470,7 @@ static int dmi_system_event_log(struct dmi_sysfs_entry *entry)kobject_del (entry->child); out_free:kfree (entry->child); + entry->child =NULL ;return ret; }
Signature · 1 line
2.31.1