CVE-2025-21660
NoneCVSS
—
EPSS
0.2%
Published
Jan 21, 2025
CISA due date
—
Cloudanix analysis
A flaw in the Linux kernel's file sharing code could let attackers create files in places they should not be able to reach, risking unauthorized changes to system or data files.
- Exploitation
- Remote Authenticated
- Attacker needs
- Low Privilege
- Complexity
- Moderate
- Impact
- Data Tampering
- Component
- OS kernel
- Class
- Path Traversal
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Unrestored path buffer after error in ksmbd_vfs_kern_path_locked allows subsequent file creation to use an attacker-controlled or altered path instead of the intended one, enabling path traversal for file operations.
Why it matters to the business
Attackers may create or overwrite files in unauthorized locations on Linux systems running the affected kernel, potentially leading to data tampering, persistence mechanisms, or escalation in file-serving environments; high prevalence in enterprise Linux deployments increases exposure risk.
How an attack unfolds
An attacker interacts with the ksmbd SMB server by sending a sequence of requests that trigger an error condition in path resolution before the final entry; the kernel fails to restore the modified path buffer, so a later creation operation uses the altered path, enabling traversal to unintended filesystem locations. No widespread threat actor campaigns noted for this specific issue.
How to fix it
Upgrade the Linux kernel to a fixed version such as 6.1.125 or the commit 13e41c58c74baa71f34c0830eaa3c29d53a6e964; for Red Hat JBCS packages apply the listed updates including jbcs-httpd24-httpd 0:2.4.6-77.SP1.jbcs.el6/el7 and equivalent for all listed httpd, mod_*, and debug/devel packages.
How to confirm the fix worked
Verify kernel version matches or exceeds fixed releases; confirm absence of the vulnerable ksmbd_vfs_kern_path_locked path handling logic via source inspection or package changelog; test SMB file creation paths under error conditions to ensure buffer restoration occurs.
Typical attack path
- Establish SMB connection to ksmbd server on vulnerable Linux kernel
- Send crafted path resolution requests that induce non-final-entry error in ksmbd_vfs_kern_path_locked
- Trigger subsequent file creation operation that consumes the unrestored path buffer
- Achieve creation of file at traversed or unexpected location
How to detect it
Review kernel and SMB audit logs for unexpected file creation attempts following path resolution errors; inspect ksmbd-related error paths and subsequent open/create calls for mismatched filenames; correlate with filesystem monitoring for files appearing outside expected directories.
What your security team should do
- Prioritize kernel upgrades on all systems exposing ksmbd/SMB services within 30 days given publication age
- Apply Red Hat JBCS package fixes where those components are in use
- Restrict SMB access to trusted networks and disable ksmbd if not required
- Monitor for unusual file creation events in shared directories
The record
In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix unexpectedly changed path in ksmbd_vfs_kern_path_locked When `ksmbd_vfs_kern_path_locked` met an error and it is not the last entry, it will exit without restoring changed path buffer. But later this buffer may be used as the filename for creation.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | linux-6.1 | 0 | 6.1.128-1~deb11u1 |
| Debian:11 | linux-6.1 | 0 | 6.1.6.1.128-1~deb11u1 |
| Debian:12 | linux | 0 | No fix |
| Debian:12 | linux | 0 | 6.1.128-1 |
| Debian:13 | linux | 0 | No fix |
| Debian:13 | linux | 0 | 6.12.10-1 |
| Linux | Kernel | 0 | 6.1.125 |
| Mageia:9 | dwarves | 0 | 1.29-1.mga9 |
| Mageia:9 | kernel | 0 | 6.6.74-1.mga9 |
| Mageia:9 | kernel-linus | 0 | 6.6.74-1.mga9 |
| Mageia:9 | kmod-virtualbox | 0 | 7.0.24-64.mga9 |
| Mageia:9 | kmod-xtables-addons | 0 | 3.24-70.mga9 |
| Ubuntu:16.04:LTS | linux-hwe-edge | 0 | No fix |
| Ubuntu:18.04:LTS | linux-aws-5.0 | 0 | No fix |
| Ubuntu:18.04:LTS | linux-aws-5.3 | 0 | No fix |
| Ubuntu:18.04:LTS | linux-azure | 0 | No fix |
| Ubuntu:18.04:LTS | linux-azure-5.3 | 0 | No fix |
| Ubuntu:18.04:LTS | linux-azure-edge | 0 | No fix |
| Ubuntu:18.04:LTS | linux-gcp | 0 | No fix |
| Ubuntu:18.04:LTS | linux-gcp-5.3 | 0 | No fix |
| Ubuntu:18.04:LTS | linux-gke-4.15 | 0 | No fix |
| Ubuntu:18.04:LTS | linux-gke-5.4 | 0 | No fix |
| Ubuntu:18.04:LTS | linux-gkeop-5.4 | 0 | No fix |
| Ubuntu:18.04:LTS | linux-hwe | 0 | No fix |
| Ubuntu:18.04:LTS | linux-hwe-edge | 0 | No fix |
| Ubuntu:18.04:LTS | linux-oem | 0 | No fix |
| Ubuntu:18.04:LTS | linux-oracle-5.0 | 0 | No fix |
| Ubuntu:18.04:LTS | linux-oracle-5.3 | 0 | No fix |
| Ubuntu:20.04:LTS | linux | 0 | No fix |
| Ubuntu:20.04:LTS | linux-aws | 0 | No fix |
| Ubuntu:20.04:LTS | linux-aws-5.11 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-aws-5.13 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-aws-5.15 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-aws-5.8 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-azure | 0 | No fix |
| Ubuntu:20.04:LTS | linux-azure-5.11 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-azure-5.13 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-azure-5.15 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-azure-5.8 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-azure-fde | 0 | No fix |
| Ubuntu:20.04:LTS | linux-azure-fde-5.15 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-bluefield | 0 | No fix |
| Ubuntu:20.04:LTS | linux-gcp | 0 | No fix |
| Ubuntu:20.04:LTS | linux-gcp-5.11 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-gcp-5.13 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-gcp-5.15 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-gcp-5.8 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-gke | 0 | No fix |
| Ubuntu:20.04:LTS | linux-gke-5.15 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-gkeop | 0 | No fix |
| Ubuntu:20.04:LTS | linux-gkeop-5.15 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-hwe-5.11 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-hwe-5.13 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-hwe-5.15 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-hwe-5.8 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-ibm | 0 | No fix |
| Ubuntu:20.04:LTS | linux-ibm-5.15 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-intel-5.13 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-intel-iotg-5.15 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-iot | 0 | No fix |
| Ubuntu:20.04:LTS | linux-kvm | 0 | No fix |
| Ubuntu:20.04:LTS | linux-lowlatency-hwe-5.15 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-oem-5.10 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-oem-5.13 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-oem-5.14 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-oem-5.6 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-oracle | 0 | No fix |
| Ubuntu:20.04:LTS | linux-oracle-5.11 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-oracle-5.13 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-oracle-5.15 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-oracle-5.8 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-raspi | 0 | No fix |
| Ubuntu:20.04:LTS | linux-raspi2 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-riscv | 0 | No fix |
| Ubuntu:20.04:LTS | linux-riscv-5.11 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-riscv-5.15 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-riscv-5.8 | 0 | No fix |
| Ubuntu:20.04:LTS | linux-xilinx-zynqmp | 0 | No fix |
| Ubuntu:22.04:LTS | linux | 0 | No fix |
| Ubuntu:22.04:LTS | linux-allwinner-5.19 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-aws | 0 | No fix |
| Ubuntu:22.04:LTS | linux-aws-5.19 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-aws-6.2 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-aws-6.5 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-aws-6.8 | 0 | 6.8.0-1029.31~22.04.1 |
| Ubuntu:22.04:LTS | linux-azure | 0 | No fix |
| Ubuntu:22.04:LTS | linux-azure-5.19 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-azure-6.2 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-azure-6.5 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-azure-6.8 | 0 | 6.8.0-1029.34~22.04.1 |
| Ubuntu:22.04:LTS | linux-azure-fde | 0 | No fix |
| Ubuntu:22.04:LTS | linux-azure-fde-5.19 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-azure-fde-6.2 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-gcp | 0 | No fix |
| Ubuntu:22.04:LTS | linux-gcp-5.19 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-gcp-6.2 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-gcp-6.5 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-gcp-6.8 | 0 | 6.8.0-1030.32~22.04.1 |
| Ubuntu:22.04:LTS | linux-gke | 0 | No fix |
| Ubuntu:22.04:LTS | linux-gkeop | 0 | No fix |
| Ubuntu:22.04:LTS | linux-hwe-5.19 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-hwe-6.2 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-hwe-6.5 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-hwe-6.8 | 0 | 6.8.0-60.63~22.04.1 |
| Ubuntu:22.04:LTS | linux-ibm | 0 | No fix |
| Ubuntu:22.04:LTS | linux-ibm-6.8 | 0 | 6.8.0-1026.26~22.04.1 |
| Ubuntu:22.04:LTS | linux-intel-iot-realtime | 0 | No fix |
| Ubuntu:22.04:LTS | linux-intel-iotg | 0 | No fix |
| Ubuntu:22.04:LTS | linux-kvm | 0 | No fix |
| Ubuntu:22.04:LTS | linux-lowlatency | 0 | No fix |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-5.19 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.2 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.5 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-lowlatency-hwe-6.8 | 0 | 6.8.0-60.63.1~22.04.1 |
| Ubuntu:22.04:LTS | linux-nvidia | 0 | No fix |
| Ubuntu:22.04:LTS | linux-nvidia-6.2 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-nvidia-6.5 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-nvidia-6.8 | 0 | 6.8.0-1028.31~22.04.1 |
| Ubuntu:22.04:LTS | linux-oem-5.17 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-oem-6.0 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-oem-6.1 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-oem-6.5 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-oracle | 0 | No fix |
| Ubuntu:22.04:LTS | linux-oracle-6.5 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-oracle-6.8 | 0 | 6.8.0-1026.27~22.04.1 |
| Ubuntu:22.04:LTS | linux-raspi | 0 | No fix |
| Ubuntu:22.04:LTS | linux-realtime | 0 | No fix |
| Ubuntu:22.04:LTS | linux-riscv | 0 | No fix |
| Ubuntu:22.04:LTS | linux-riscv-5.19 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-riscv-6.5 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-riscv-6.8 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-riscv-6.8 | 0 | 6.8.0-62.65~22.04.1 |
| Ubuntu:22.04:LTS | linux-starfive-5.19 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-starfive-6.2 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-starfive-6.5 | 0 | No fix |
| Ubuntu:22.04:LTS | linux-xilinx-zynqmp | 0 | No fix |
| Ubuntu:22.04:LTS:for:NVIDIA:BlueField | linux-bluefield | 0 | No fix |
| Ubuntu:24.04:LTS | linux | 0 | No fix |
| Ubuntu:24.04:LTS | linux | 0 | 6.8.0-60.63 |
| Ubuntu:24.04:LTS | linux-aws | 0 | No fix |
| Ubuntu:24.04:LTS | linux-aws | 0 | 6.8.0-1029.31 |
| Ubuntu:24.04:LTS | linux-azure | 0 | No fix |
| Ubuntu:24.04:LTS | linux-azure | 0 | 6.8.0-1029.34 |
| Ubuntu:24.04:LTS | linux-azure-fde | 0 | No fix |
| Ubuntu:24.04:LTS | linux-azure-nvidia | 0 | 6.8.0-1016.17 |
| Ubuntu:24.04:LTS | linux-gcp | 0 | No fix |
| Ubuntu:24.04:LTS | linux-gcp | 0 | 6.8.0-1030.32 |
| Ubuntu:24.04:LTS | linux-gke | 0 | No fix |
| Ubuntu:24.04:LTS | linux-gke | 0 | 6.8.0-1025.29 |
| Ubuntu:24.04:LTS | linux-gkeop | 0 | No fix |
| Ubuntu:24.04:LTS | linux-gkeop | 0 | 6.8.0-1012.14 |
| Ubuntu:24.04:LTS | linux-hwe-6.11 | 0 | 6.11.0-21.21~24.04.1 |
| Ubuntu:24.04:LTS | linux-ibm | 0 | No fix |
| Ubuntu:24.04:LTS | linux-ibm | 0 | 6.8.0-1026.26 |
| Ubuntu:24.04:LTS | linux-lowlatency | 0 | No fix |
| Ubuntu:24.04:LTS | linux-lowlatency | 0 | 6.8.0-60.63.1 |
| Ubuntu:24.04:LTS | linux-nvidia | 0 | No fix |
| Ubuntu:24.04:LTS | linux-nvidia | 0 | 6.8.0-1028.31 |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 0 | No fix |
| Ubuntu:24.04:LTS | linux-nvidia-lowlatency | 0 | 6.8.0-1028.31.1 |
| Ubuntu:24.04:LTS | linux-nvidia-tegra | 0 | No fix |
| Ubuntu:24.04:LTS | linux-nvidia-tegra | 0 | 6.8.0-1008.8 |
| Ubuntu:24.04:LTS | linux-oem-6.11 | 0 | No fix |
| Ubuntu:24.04:LTS | linux-oem-6.11 | 0 | 6.11.0-1017.17 |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 0 | No fix |
| Ubuntu:24.04:LTS | linux-oem-6.8 | 0 | 6.8.0-1028.28 |
| Ubuntu:24.04:LTS | linux-oracle | 0 | No fix |
| Ubuntu:24.04:LTS | linux-oracle | 0 | 6.8.0-1026.27 |
| Ubuntu:24.04:LTS | linux-raspi | 0 | No fix |
| Ubuntu:24.04:LTS | linux-raspi | 0 | 6.8.0-1028.32 |
| Ubuntu:24.04:LTS | linux-raspi-realtime | 0 | No fix |
| Ubuntu:24.04:LTS | linux-realtime | 0 | No fix |
| Ubuntu:24.04:LTS | linux-riscv | 0 | No fix |
| Ubuntu:24.04:LTS | linux-riscv | 0 | 6.8.0-60.63.1 |
| Ubuntu:24.10 | linux | 0 | No fix |
| Ubuntu:24.10 | linux-aws | 0 | No fix |
| Ubuntu:24.10 | linux-azure | 0 | No fix |
| Ubuntu:24.10 | linux-gcp | 0 | No fix |
| Ubuntu:24.10 | linux-lowlatency | 0 | No fix |
| Ubuntu:24.10 | linux-lowlatency | 0 | 6.11.0-1011.12 |
| Ubuntu:24.10 | linux-oracle | 0 | No fix |
| Ubuntu:24.10 | linux-raspi | 0 | No fix |
| Ubuntu:24.10 | linux-raspi | 0 | 6.11.0-1010.10 |
| Ubuntu:24.10 | linux-realtime | 0 | No fix |
| Ubuntu:24.10 | linux-riscv | 0 | No fix |
| Ubuntu:25.04 | linux-azure-fde | 0 | No fix |
| Ubuntu:Pro:14.04:LTS | linux | 0 | No fix |
| Ubuntu:Pro:14.04:LTS | linux-aws | 0 | No fix |
| Ubuntu:Pro:14.04:LTS | linux-azure | 0 | No fix |
| Ubuntu:Pro:14.04:LTS | linux-lts-xenial | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | linux | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | linux-aws | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | linux-aws-hwe | 0 | No fix |
Related vulnerabilities
- CVE-2025-37924 In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix… Also affects linux-6.1
- CVE-2025-21760 In the Linux kernel, the following vulnerability has been resolved: ndisc: extend RCU… Also affects linux-6.1
- CVE-2025-21758 In the Linux kernel, the following vulnerability has been resolved: ipv6: mcast: add RCU… Also affects linux-6.1
- CVE-2025-21664 In the Linux kernel, the following vulnerability has been resolved: dm thin: make… Also affects linux-6.1
- CVE-2024-57946 In the Linux kernel, the following vulnerability has been resolved: virtio-blk: don't… Also affects linux-6.1
- CVE-2024-57945 In the Linux kernel, the following vulnerability has been resolved: riscv: mm: Fix the… Also affects linux-6.1
- CVE-2025-21662 In the Linux kernel, the following vulnerability has been resolved: net/mlx5: Fix… Also affects linux-6.1
- CVE-2024-57940 In the Linux kernel, the following vulnerability has been resolved: exfat: fix the… Also affects linux-6.1