CVE-2024-40910: ax25: Fix refcount imbalance on inbound connections
In the Linux kernel, the following vulnerability has been resolved:
ax25: Fix refcount imbalance on inbound connections
When releasing a socket in ax25release(), we call netdevput() to decrease the refcount on the associated ax.25 device. However, the execution path for accepting an incoming connection never calls netdevhold(). This imbalance leads to refcount errors, and ultimately to kernel crashes.
A typical call trace for the above situation will start with one of the following errors:
refcountt: decrement hit 0; leaking memory. refcountt: underflow; use-after-free.
And will then have a trace like:
Call Trace: <TASK> ? showregs+0x64/0x70 ? warn+0x83/0x120 ? refcountwarnsaturate+0xb2/0x100 ? reportbug+0x158/0x190 ? prbreadvalid+0x20/0x30 ? handlebug+0x3e/0x70 ? excinvalidop+0x1c/0x70 ? asmexcinvalidop+0x1f/0x30 ? refcountwarnsaturate+0xb2/0x100 ? refcountwarnsaturate+0xb2/0x100 ax25release+0x2ad/0x360 sockrelease+0x35/0xa0 sockclose+0x19/0x20 [...]
On reboot (or any attempt to remove the interface), the kernel gets stuck in an infinite loop:
unregisternetdevice: waiting for ax0 to become free. Usage count = 0
This patch corrects these issues by ensuring that we call netdevhold() and ax25devhold() for new connections in ax25accept(). This makes the logic leading to ax25accept() match the logic for ax25bind(): in both cases we increment the refcount, which is ultimately decremented in ax25release().
Other sources
This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.
— Launchpad
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.25-1Fixed in 6.12.27-1 - Upgrade
Upgrade
debian/linux-6.1to a version that resolves this vulnerability.Fixed in 6.1.129-1~deb11u1 - Upgrade
Upgrade
Linux kernelto a version that resolves this vulnerability.Patch ax25: Fix refcount imbalance on inbound connections
Event History
Frequently Asked Questions
What is the severity of CVE-2024-40910?
CVE-2024-40910 has been classified with medium severity due to the risk of a refcount imbalance that could potentially lead to denial of service.
How do I fix CVE-2024-40910?
To fix CVE-2024-40910, update your Linux kernel to the recommended patched versions such as 6.1.123-1, 6.1.128-1, or any versions above 6.12.12-1.
Which Linux kernel versions are affected by CVE-2024-40910?
CVE-2024-40910 affects Linux kernel versions between 5.18 through 6.1.95, as well as versions from 6.2 up to 6.6.35 and 6.7 to 6.9.6.
What type of vulnerability is CVE-2024-40910?
CVE-2024-40910 is a refcount imbalance vulnerability occurring in the ax25 networking subsystem of the Linux kernel.
Is there a workaround for CVE-2024-40910?
There are no reliable workarounds for CVE-2024-40910; updating to a patched kernel is the preferred mitigation method.