CVE-2024-36940·Kernel vulnerability
In the Linux kernel, the following vulnerability has been resolved: pinctrl: core: delete incorrect free in pinctrl_enable() The "pctldev" struct is allocated in devm_pinctrl_register_and_init(). It's a devm_ managed pointer that is freed by devm_pinctrl_dev_release(), so freeing it in pinctrl_enable() will lead to a double free. The devm_pinctrl_dev_release() function frees the pindescs and destroys the mutex as well.
- Severity
- high
- Software
- Kernel
- Fixed in
- 6.8.10
- Published
- 2024-05-30
Affected versions
From: 6.7
Until: 6.8.10
Fixed in: 6.8.10
How to fix this CVE
Update your Linux kernel to version 6.8.10 or later to resolve a double-free vulnerability in the pinctrl subsystem. This flaw occurs when pinctrl_enable() incorrectly attempts to free device-managed memory that is already tracked by the kernel's devm allocator, potentially causing kernel crashes or memory corruption. Apply the patch immediately through your distribution's kernel update mechanism.
sudo dnf update kernel kernel-devel kernel-headersDefensia detects this vulnerability
How to check if you are affected
- Check kernel version: uname -r — confirm it is 6.8.10 or later
- Verify pinctrl module is loaded: lsmod | grep pinctrl — check if vulnerable subsystem is active on your system
- Search kernel logs for pinctrl errors: sudo dmesg | grep -i pinctrl — look for double-free warnings or kernel oops messages
- Validate patch application: grep -r 'pinctrl_enable' /usr/src/linux-headers-$(uname -r)/ 2>/dev/null | head -5 — inspect source to confirm devm allocation fix is in place
FAQ
What is CVE-2024-36940?
CVE-2024-36940 is a double-free vulnerability in the Linux kernel's pinctrl (pin control) subsystem. The pinctrl_enable() function incorrectly attempts to free device-managed memory that is already automatically freed by the kernel's devm allocator, leading to memory corruption or kernel panic.
Is CVE-2024-36940 being actively exploited?
No, this vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog and no public exploits are available. It requires local kernel code execution capability to trigger.
What versions of Kernel are affected by CVE-2024-36940?
Linux kernel versions 6.7 through 6.8.9 are affected. The vulnerability was fixed in kernel 6.8.10 and later stable releases.
How do I check if my server is vulnerable to CVE-2024-36940?
Run `uname -r` to check your kernel version. If it returns a version between 6.7.x and 6.8.9 (inclusive), your system is vulnerable. Verify the pinctrl module is in use with `lsmod | grep pinctrl`.
Does Defensia detect CVE-2024-36940?
Yes — Defensia's CVE advisory scanner compares installed package versions against the NVD database. If the Linux kernel is installed on a monitored server running version 6.7–6.8.9, CVE-2024-36940 will appear in your dashboard with remediation steps and patch availability.
Related Kernel CVEs
References
- https://git.kernel.org/stable/c/288bc4aa75f150d6f1ee82dd43c6da1b438b6068
- https://git.kernel.org/stable/c/41f88ef8ba387a12f4a2b8c400b6c9e8e54b2cca
- https://git.kernel.org/stable/c/5038a66dad0199de60e5671603ea6623eb9e5c79
- https://git.kernel.org/stable/c/558c8039fdf596a584a92c171cbf3298919c448c
- https://git.kernel.org/stable/c/735f4c6b6771eafe336404c157ca683ad72a040d
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2024-36940. Free for 1 server.
Get started free