CVE-2025-21792: ax25: Fix refcount leak caused by setting SO_BINDTODEVICE sockopt
In the Linux kernel, the following vulnerability has been resolved:
ax25: Fix refcount leak caused by setting SO_BINDTODEVICE sockopt
If an AX25 device is bound to a socket by setting the SO_BINDTODEVICE
socket option, a refcount leak will occur in ax25_release().
Commit 9fd75b66b8f6 ("ax25: Fix refcount leaks caused by ax25_cb_del()")
added decrement of device refcounts in ax25_release(). In order for that
to work correctly the refcounts must already be incremented when the
device is bound to the socket. An AX25 device can be bound to a socket
by either calling ax25_bind() or setting SO_BINDTODEVICE socket option.
In both cases the refcounts should be incremented, but in fact it is done
only in ax25_bind().
This bug leads to the following issue reported by Syzkaller:
================================================================
refcount_t: decrement hit 0; leaking memory.
WARNING: CPU: 1 PID: 5932 at lib/refcount.c:31 refcount_warn_saturate+0x1ed/0x210 lib/refcount.c:31
Modules linked in:
CPU: 1 UID: 0 PID: 5932 Comm: syz-executor424 Not tainted 6.13.0-rc4-syzkaller-00110-g4099a71718b0 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:refcount_warn_saturate+0x1ed/0x210 lib/refcount.c:31
Call Trace:
<TASK>
__refcount_dec include/linux/refcount.h:336 [inline]
refcount_dec include/linux/refcount.h:351 [inline]
ref_tracker_free+0x710/0x820 lib/ref_tracker.c:236
netdev_tracker_free include/linux/netdevice.h:4156 [inline]
netdev_put include/linux/netdevice.h:4173 [inline]
netdev_put include/linux/netdevice.h:4169 [inline]
ax25_release+0x33f/0xa10 net/ax25/af_ax25.c:1069
__sock_release+0xb0/0x270 net/socket.c:640
sock_close+0x1c/0x30 net/socket.c:1408
...
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
...
</TASK>
================================================================
Fix the implementation of ax25_setsockopt() by adding increment of
refcounts for the new device bound, and decrement of refcounts for
the old unbound device.
Security readout for executives and security teams
Plain-English summary
CVE-2025-21792 is a Linux kernel availability flaw in AX.25 networking. A local user can trigger incorrect device reference counting when a socket is bound to an AX.25 device using SO_BINDTODEVICE. The reported impact is service disruption, not data theft or privilege escalation.
Executive priority
Treat as a routine but real Linux kernel availability risk. Prioritize patching on multi-user or externally managed Linux systems where local users can run code. It does not currently justify emergency response based on the provided evidence.
Technical view
The AX.25 socket cleanup path decremented network device references in ax25_release(), but ax25_setsockopt() did not increment references when binding a device through SO_BINDTODEVICE. This mismatch can produce a refcount leak or saturation warning during socket release. The kernel fix adds reference increments for newly bound devices and decrements for old unbound devices.
Likely exposure
Exposure is most likely on Linux systems running affected kernel builds with AX.25 networking enabled or available. This is a local attack surface, so internet-facing exposure is not indicated by the sources.
Exploitation context
The issue was reported by Syzkaller. The source bundle does not show CISA KEV listing or other evidence of active exploitation. CVSS marks local access, low complexity, low privileges, no user interaction, and high availability impact.
Researcher notes
Focus validation on AX.25 socket/device binding behavior and kernel versions carrying the stable fixes. The public description provides root cause and crash context, but not complete distro-by-distro affected package mapping beyond the Debian LTS reference.
Mitigation direction
Update to a vendor kernel containing the referenced stable AX.25 fixes.
Review Debian LTS or other distribution advisories for corrected package versions.
Disable or restrict AX.25 support where it is not operationally required.
Prioritize shared multi-user Linux systems over isolated single-user hosts.
Validation and detection
Inventory Linux kernel versions against vendor advisories and fixed stable commits.
Check whether AX.25 support is enabled, loadable, or required on affected hosts.
Confirm updated kernels include the AX.25 SO_BINDTODEVICE refcount fix.
Verify no production dependency requires delaying AX.25-related kernel updates.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2025-21792 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.