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

From: <hidden>
Date: 2021-03-22 15:20:10
Also in: lkml

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.



Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help