CVE-2025-21672
Medium · 5.5CVSS
5.5
EPSS
0.1%
Published
Jan 31, 2025
CISA due date
—
Cloudanix analysis
A small error-handling mistake in the Linux kernel could leave internal locks held when talking to user programs, risking warnings or instability on systems that use the AFS file system.
- Exploitation
- Local Privilege
- Attacker needs
- Local User
- Complexity
- Moderate
- Impact
- Denial Of Service
- Component
- OS kernel
- Class
- Other
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Early return in afs_proc_addr_prefs_write when argc < 0 leaves the inode lock held, violating the requirement to release locks before returning to userspace.
Why it matters to the business
Linux systems using the AFS client may experience kernel warnings and potential lock-related instability during address preference updates; the low EPSS and lack of KEV listing indicate limited real-world risk, though kernel updates remain advisable for stability.
How an attack unfolds
An attacker triggers the AFS proc interface write handler with crafted input causing argc to be negative, hitting the direct return path before the lock release in the done label; no named threat actors are associated with this specific issue.
How to fix it
Upgrade the Linux kernel to the commit 22be1d90a6211c88dd093b25d1f3aa974d0d9f9d or later stable releases that contain the fix for proper error handling and lock release via the done label.
How to confirm the fix worked
Confirm the kernel source contains the corrected afs_proc_addr_prefs_write logic that stores the error and jumps to done; verify absence of the lock-held warning when exercising the address prefs proc interface.
Typical attack path
- Obtain local access to a system running the vulnerable Linux kernel with AFS enabled
- Write to /proc/fs/afs/addr_prefs with input that sets argc < 0
- Trigger the early return in afs_proc_addr_prefs_write
- Observe the 'lock held when returning to user space' warning
How to detect it
Search kernel logs and dmesg output for the exact warning string 'lock held when returning to user space' together with references to afs_proc_addr_prefs_write or inode_lock.
- WARNING: lock held when returning to user space!
- afs_proc_addr_prefs_write
- inode_lock include/linux/fs.h
What your security team should do
- Apply the kernel patch or upgrade to a fixed version containing commit 22be1d90a6211c88dd093b25d1f3aa974d0d9f9d
- Monitor kernel logs for 'lock held when returning to user space' warnings on AFS-enabled systems
- Prioritize updates on any production systems running AFS clients even though exploit maturity is none
The record
In the Linux kernel, the following vulnerability has been resolved: afs: Fix merge preference rule failure condition syzbot reported a lock held when returning to userspace[1]. This is because if argc is less than 0 and the function returns directly, the held inode lock is not released. Fix this by store the error in ret and jump to done to clean up instead of returning directly. [dh: Modified Lizhi Xu's original patch to make it honour the error code from afs_split_string()] [1] WARNING: lock held when returning to user space! 6.13.0-rc3-syzkaller-00209-g499551201b5f #0 Not tainted ------------------------------------------------ syz-executor133/5823 is leaving the kernel with locks still held! 1 lock held by syz-executor133/5823: #0: ffff888071cffc00 (&sb->s_type->i_mutex_key#9){++++}-{4:4}, at: inode_lock include/linux/fs.h:818 [inline] #0: ffff888071cffc00 (&sb->s_type->i_mutex_key#9){++++}-{4:4}, at: afs_proc_addr_prefs_write+0x2bb/0x14e0 fs/afs/addr_prefs.c:388
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| AlmaLinux:9 | kernel | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-64k | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-64k-core | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-64k-debug | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-64k-debug-core | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-64k-debug-devel | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-64k-debug-devel-matched | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-64k-debug-modules | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-64k-debug-modules-core | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-64k-debug-modules-extra | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-64k-devel | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-64k-devel-matched | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-64k-modules | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-64k-modules-core | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-64k-modules-extra | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-abi-stablelists | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-core | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-cross-headers | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-debug | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-debug-core | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-debug-devel | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-debug-devel-matched | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-debug-modules | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-debug-modules-core | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-debug-modules-extra | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-debug-uki-virt | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-devel | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-devel-matched | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-doc | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-headers | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-modules | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-modules-core | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-modules-extra | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-64k | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-64k-core | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-64k-debug | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-64k-debug-core | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-64k-debug-devel | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-64k-debug-modules | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-64k-debug-modules-core | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-64k-debug-modules-extra | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-64k-devel | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-64k-modules | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-64k-modules-core | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-64k-modules-extra | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-core | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-debug | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-debug-core | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-debug-devel | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-debug-modules | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-debug-modules-core | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-debug-modules-extra | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-devel | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-modules | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-modules-core | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-rt-modules-extra | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-tools | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-tools-libs | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-tools-libs-devel | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-uki-virt | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-uki-virt-addons | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-zfcpdump | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-zfcpdump-core | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-zfcpdump-devel | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-zfcpdump-devel-matched | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-zfcpdump-modules | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-zfcpdump-modules-core | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | kernel-zfcpdump-modules-extra | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | libperf | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | perf | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | python3-perf | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | rtla | 0 | 5.14.0-611.5.1.el9_7 |
| AlmaLinux:9 | rv | 0 | 5.14.0-611.5.1.el9_7 |
| Debian:11 | linux | 0 | No fix |
| Debian:12 | linux | 0 | No fix |
| Debian:13 | linux | 0 | 6.12.11-1 |
| Linux | Kernel | 6.8.0 | 6.12.11 |
Related vulnerabilities
- CVE-2025-68285 In the Linux kernel, the following vulnerability has been resolved: libceph: fix… Also affects kernel
- CVE-2025-68287 In the Linux kernel, the following vulnerability has been resolved: usb: dwc3: Fix race… Also affects kernel
- CVE-2025-40277 In the Linux kernel, the following vulnerability has been resolved: drm/vmwgfx: Validate… Also affects kernel
- CVE-2025-40240 In the Linux kernel, the following vulnerability has been resolved: sctp: avoid NULL… Also affects kernel
- CVE-2025-40185 In the Linux kernel, the following vulnerability has been resolved: ice: ice_adapter… Also affects kernel
- CVE-2025-40176 In the Linux kernel, the following vulnerability has been resolved: tls: wait for pending… Also affects kernel
- CVE-2025-40058 In the Linux kernel, the following vulnerability has been resolved: iommu/vt-d: Disallow… Also affects kernel
- CVE-2025-39981 In the Linux kernel, the following vulnerability has been resolved: Bluetooth: MGMT: Fix… Also affects kernel