firmware: fix one UAF issue
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 <loydlv@tencent.com> Signed-off-by: Xinghui Li <korantli@tencent.com>
This commit is contained in:
parent
84daaf3511
commit
5c899e5403
|
@ -470,6 +470,7 @@ out_del:
|
|||
kobject_del(entry->child);
|
||||
out_free:
|
||||
kfree(entry->child);
|
||||
entry->child = NULL;
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue