Refcount Leak in altera_tse_mdio_create in Kernel
Summary
GSD-2022-1003515: net: altera: Fix refcount leak in altera_tse_mdio_create. Affects Kernel versions >= bbd2190ce96d8fce031f0526c1f970b68adc9d1a, < 96bf5ed057df2d157274d4e2079002f9a9404bb8. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The Kernel is a fundamental component of the Linux operating system that provides core functionalities and acts as an interface between hardware and software. It manages system resources, facilitates communication between different software components, and ensures the stability and security of the system. The altera_tse_mdio_create function in the Kernel's altera module is responsible for creating a management data input/output (MDIO) interface for Altera Triple-Speed Ethernet (TSE) devices. This interface allows communication with the MDIO bus, which is used for controlling and monitoring Ethernet PHYs (Physical Layer transceivers).
Vulnerability Detail
The altera_tse_mdio_create function in the Kernel's altera module suffers from a refcount leak vulnerability. This vulnerability occurs when the function fails to properly release a reference count on a data structure, leading to a resource leak. An attacker could exploit this vulnerability by repeatedly creating and destroying MDIO interfaces, causing the refcount to increment and eventually exhaust system resources. This could result in a denial-of-service (DoS) condition or other unexpected behavior. The vulnerability was introduced in version v3.15 of the Linux Kernel and is fixed in version v5.10.122.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a workaround, users can apply a patch manually to fix the refcount leak in the altera_tse_mdio_create function. The patch involves modifying the affected code to properly release the reference count on the data structure. Here is an example of the patch:
--- a/drivers/net/ethernet/altera/altera_tse_main.c
+++ b/drivers/net/ethernet/altera/altera_tse_main.c
@@ -123,7 +123,7 @@ struct altera_tse_private {
struct mii_bus *mdio;
struct device *dev;
struct napi_struct napi;
- int refcount;
+ atomic_t refcount;
int irq;
int link_speed;
int link_duplex;
Conclusion
In conclusion, the altera_tse_mdio_create function in the Kernel's altera module suffers from a refcount leak vulnerability. This vulnerability can be fixed by updating the Linux Kernel to version v5.10.122 or later. Alternatively, users can apply a patch manually to address the issue. It is important to take action to mitigate this vulnerability and ensure the security and stability of the system. For further support on vulnerability remediation, you can contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The vulnerability could lead to a denial-of-service (DoS) condition or other unexpected behavior in systems using the affected Kernel version. It could allow an attacker to exhaust system resources by repeatedly creating and destroying MDIO interfaces.
You can use Vulert's playground (https://vulert.com/scanner) to check if your system is affected by this vulnerability. Vulert monitors and alerts in real-time for open-source vulnerabilities, using just a manifest file like package-lock.json.
Yes, a workaround is available. Users can manually apply a patch to fix the refcount leak in the altera_tse_mdio_create function. The patch involves modifying the affected code to properly release the reference count on the data structure.
To fix this vulnerability, it is recommended to update the Linux Kernel to version v5.10.122 or later. This update includes a commit that addresses the refcount leak in the altera_tse_mdio_create function.
You can find more information about this vulnerability in the GSD-2022-1003515 entry of the GSD database (https://github.com/cloudsecurityalliance/gsd-database/blob/main/2022/1003xxx/GSD-2022-1003515.json).
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.