mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
net/qlcnic: Fix a use after free in qlcnic_83xx_get_minidump_template
[ Upstream commitdb74623a38] In qlcnic_83xx_get_minidump_template, fw_dump->tmpl_hdr was freed by vfree(). But unfortunately, it is used when extended is true. Fixes:7061b2bdd6("qlogic: Deletion of unnecessary checks before two function calls") Signed-off-by: Lv Yunlong <lyl2019@mail.ustc.edu.cn> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
baf4fabcd5
commit
646b4ca277
@@ -1426,6 +1426,7 @@ void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter)
|
||||
|
||||
if (fw_dump->tmpl_hdr == NULL || current_version > prev_version) {
|
||||
vfree(fw_dump->tmpl_hdr);
|
||||
fw_dump->tmpl_hdr = NULL;
|
||||
|
||||
if (qlcnic_83xx_md_check_extended_dump_capability(adapter))
|
||||
extended = !qlcnic_83xx_extend_md_capab(adapter);
|
||||
@@ -1444,6 +1445,8 @@ void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *adapter)
|
||||
struct qlcnic_83xx_dump_template_hdr *hdr;
|
||||
|
||||
hdr = fw_dump->tmpl_hdr;
|
||||
if (!hdr)
|
||||
return;
|
||||
hdr->drv_cap_mask = 0x1f;
|
||||
fw_dump->cap_mask = 0x1f;
|
||||
dev_info(&pdev->dev,
|
||||
|
||||
Reference in New Issue
Block a user