qlcnic: prevent ->dcb use-after-free on qlcnic_dcb_enable() failure
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
|
≥ 3c44bba1d270cb1620b4fe76786d0968118cb86b · < 8df1dc04ce0e4c03b51a756749c250a9cb17d707| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
qlcnic: prevent ->dcb use-after-free on qlcnic_dcb_enable() failure
adapter->dcb would get silently freed inside qlcnic_dcb_enable() in case qlcnic_dcb_attach() would return an error, which always happens under OOM conditions. This would lead to use-after-free because both of the existing callers invoke qlcnic_dcb_get_info() on the obtained pointer, which is potentially freed at that point.
Propagate errors from qlcnic_dcb_enable(), and instead free the dcb pointer at callsite using qlcnic_dcb_free(). This also removes the now unused qlcnic_clear_dcb_ops() helper, which was a simple wrapper around kfree() also causing memory leaks for partially initialized dcb.
Found by Linux Verification Center (linuxtesting.org) with the SVACE static analysis tool.
From the CVE record · Linux
The Linux kernel's qlcnic driver can use a freed DCB pointer if qlcnic_dcb_attach() fails under out-of-memory conditions. The input does not describe an attacker path, authentication requirements, or user interaction.
Engineers running Linux kernels with the qlcnic driver should check their kernel versions; affected versions are not specified.