!665 [HUST CSE] fix a use-after-free bug in uncore_pci_remove()
Merge Pull Request from: @liu-ziqin https://gitee.com/openeuler/kernel/blob/OLK-5.10/arch/x86/events/zhaoxin/uncore.c#L1692 released the variable 'box', however https://gitee.com/openeuler/kernel/blob/OLK-5.10/arch/x86/events/zhaoxin/uncore.c#L1694 dereferenced the freed memory 'box'(box->pmu->type->name),resulting use-after-free bug. This bug can be fixed by defining variable 'name' to temporarily store the value of box->pmu->type->name,and replacing 'box->pmu->type->name' in the condition check at L1694 with 'name'. Link:https://gitee.com/openeuler/kernel/pulls/665 Reviewed-by:Zheng Zengkai <zhengzengkai@huawei.com> Signed-off-by:
Zheng Zengkai <zhengzengkai@huawei.com>
Loading
Please sign in to comment