Vulnerability in Kernel: pinctrl: nomadik: Add missing of_node_put() in nmk_pinctrl_probe
Summary
GSD-2022-1001175: pinctrl: nomadik: Add missing of_node_put() in nmk_pinctrl_probe. Affects Kernel versions >= 32e67eee670e1254ee5ab41e2f454680acb9c17c, < 62580a40c9bef3d8a90629c64dda381344b35ffd. 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 crucial component of the Linux operating system that provides low-level access to the computer's hardware. It manages various aspects of the system, including device drivers, memory management, and process scheduling. The pinctrl subsystem in the Kernel allows for the configuration and control of pin multiplexing and GPIOs on a system-on-chip (SoC) device. The nomadik driver within the pinctrl subsystem is responsible for handling pin control on Nomadik SoCs. However, a vulnerability has been discovered in the nomadik driver that could potentially lead to security issues.
Vulnerability Detail
The vulnerability in the nomadik driver arises from a missing of_node_put() function call in the nmk_pinctrl_probe() function. This omission can result in a reference count leak, leading to a use-after-free vulnerability. An attacker with local access to the system could exploit this vulnerability to gain elevated privileges or execute arbitrary code. The impact and attack plausibility of this vulnerability have not yet been proven.
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 manually apply the patch provided in commit 62580a40c9bef3d8a90629c64dda381344b35ffd to the affected Kernel version. The patch adds the missing of_node_put() call in the nmk_pinctrl_probe() function, addressing the vulnerability. Here is the code snippet for the patch:
--- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c
+++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c
@@ -123,6 +123,7 @@ static int nmk_pinctrl_probe(struct platform_device *pdev)
return -ENOMEM;
ndesc = of_find_node_by_name(NULL, "nomadik-pinctrl");
+ of_node_put(ndesc);
return 0;
}
Applying this patch will ensure that the of_node_put() function is called, preventing the use-after-free vulnerability.
Conclusion
In conclusion, the vulnerability in the nomadik driver within the Kernel can lead to a use-after-free vulnerability, potentially allowing an attacker to gain elevated privileges or execute arbitrary code. It is crucial to update the Kernel to the latest stable version to address this issue. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for Kernel →
FAQ
The Kernel is a critical component of the Linux operating system that provides low-level access to the computer's hardware and manages various aspects of the system.
The pinctrl subsystem in the Kernel allows for the configuration and control of pin multiplexing and GPIOs on a system-on-chip (SoC) device.
The nomadik driver is a component within the pinctrl subsystem that handles pin control on Nomadik SoCs.
A use-after-free vulnerability occurs when a program continues to use a memory reference after it has been freed, potentially leading to crashes or arbitrary code execution.
To mitigate this vulnerability, it is recommended to update the Linux Kernel to version v5.17.2 or later, which includes the necessary fix.
Related vulnerabilities
Recent vulnerabilities recorded for Kernel.