2021-03-22 15:23:15

by Lv Yunlong

[permalink] [raw]
Subject: [Bug] qlogic/qlcnic: Report a potential use after free in qlcnic_probe

Hi,
my static analyzer tool reported a potential uaf in qlcnic_probe.

The problem file is drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c in
Linux Kernel-5.12-rc2.

In funtion qlcnic_probe around line 2623, it calls qlcnic_dcb_enable()
to enable adapter->dcb. But the adapter->dcb could be freed inside
this callee when qlcnic_dcb_attach(dcb) return non-zero.

Later the adapter->dcb is used by qlcnic_dcb_get_info(adapter->dcb)
and could cause a use after free.

Thanks for your time.