CVE-2025-21792

Source
https://nvd.nist.gov/vuln/detail/CVE-2025-21792
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-21792.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-21792
Downstream
Related
Published
2025-02-27T02:18:29.653Z
Modified
2025-11-27T02:33:19.418613Z
Severity
  • 5.5 (Medium) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H CVSS Calculator
Summary
ax25: Fix refcount leak caused by setting SO_BINDTODEVICE sockopt
Details

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 SOBINDTODEVICE socket option, a refcount leak will occur in ax25release().

Commit 9fd75b66b8f6 ("ax25: Fix refcount leaks caused by ax25cbdel()") added decrement of device refcounts in ax25release(). 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 ax25bind() or setting SOBINDTODEVICE socket option. In both cases the refcounts should be incremented, but in fact it is done only in ax25bind().

This bug leads to the following issue reported by Syzkaller:

================================================================ refcountt: decrement hit 0; leaking memory. WARNING: CPU: 1 PID: 5932 at lib/refcount.c:31 refcountwarnsaturate+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:refcountwarnsaturate+0x1ed/0x210 lib/refcount.c:31 Call Trace: <TASK> _refcountdec include/linux/refcount.h:336 [inline] refcountdec include/linux/refcount.h:351 [inline] reftrackerfree+0x710/0x820 lib/reftracker.c:236 netdevtrackerfree include/linux/netdevice.h:4156 [inline] netdevput include/linux/netdevice.h:4173 [inline] netdevput include/linux/netdevice.h:4169 [inline] ax25release+0x33f/0xa10 net/ax25/afax25.c:1069 _sockrelease+0xb0/0x270 net/socket.c:640 sockclose+0x1c/0x30 net/socket.c:1408 ... dosyscallx64 arch/x86/entry/common.c:52 [inline] dosyscall64+0xcd/0x250 arch/x86/entry/common.c:83 entrySYSCALL64afterhwframe+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.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/blob/cc431b3424123d84bcd7afd4de150b33f117a8ef/cves/2025/21xxx/CVE-2025-21792.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
9fd75b66b8f68498454d685dc4ba13192ae069b0
Fixed
90056ece99966182dc0e367f3fd2afab46ada847
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
9fd75b66b8f68498454d685dc4ba13192ae069b0
Fixed
94a0de224ed52eb2ecd4f4cb1b937b674c9fb955
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
9fd75b66b8f68498454d685dc4ba13192ae069b0
Fixed
b58f7ca86a7b8e480c06e30c5163c5d2f4e24023
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
9fd75b66b8f68498454d685dc4ba13192ae069b0
Fixed
470bda72fda0fcf54300466d70ce2de62f7835d2
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
9fd75b66b8f68498454d685dc4ba13192ae069b0
Fixed
bca0902e61731a75fc4860c8720168d9f1bae3b6
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
c44a453ffe16eb08acdc6129ac4fa0192dbc0456
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
de55a1338e6a48ff1e41ea8db1432496fbe2a62b
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
9e1e088a57c23251f1cfe9601bbd90ade2ea73b9
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
b20a5ab0f5fb175750c6bafd4cf12daccf00c738
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
452ae92b99062d2f6a34324eaf705a3b7eac9f8b
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
534156dd4ed768e30a43de0036f45dca7c54818f

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.18.0
Fixed
6.1.129
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.79
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.16
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.13.4