net: phylink: correctly validate returned PCS in phylink_inband_caps
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
6.18.507.2.47.3In the Linux kernel, the following vulnerability has been resolved:
net: phylink: correctly validate returned PCS in phylink_inband_caps
In phylink_inband_caps(), the PCS returned by mac_select_pcs is only checked if NULL but mac_select_pcs can also return an error pointer.
This can cause a kernel panic as phylink_pcs_inband_caps() only checks if passed PCS is not NULL and directly dereference ops from the phylink_pcs struct.
Use the IS_ERR_OR_NULL macro to address both case where the returned PCS can be NULL or an error pointer and prevent a kernel panic.
From the CVE record · Linux
The Linux kernel's phylink_inband_caps() checks whether the PCS returned by mac_select_pcs is NULL, but not whether it is an error pointer. If an error pointer is returned, the kernel can panic when it is dereferenced. The input does not specify an attacker path, access requirements, or user interaction.
Engineers running Linux kernels with the affected phylink code should check their builds; affected versions are not specified.