Unverified Commit e5016f29 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!687 [HUST CSE] fix a use-after-free bug in uncore_pci_remove()

Merge Pull Request from: @ihopenot 
 
https://gitee.com/openeuler/kernel/blob/openEuler-1.0-LTS/arch/x86/events/zhaoxin/uncore.c#L1689
released the variable 'box',
however https://gitee.com/openeuler/kernel/blob/openEuler-1.0-LTS/arch/x86/events/zhaoxin/uncore.c#L1691
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 L1691 with 'name'. 
 
Link:https://gitee.com/openeuler/kernel/pulls/687

 

Reviewed-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parents 93ad695d 6368e689
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment