CVE-2025-39735 Overview
CVE-2025-39735 is an out-of-bounds read vulnerability in the Linux kernel's JFS (Journaled File System) subsystem, specifically within the ea_get() function responsible for handling extended attributes (xattr). The vulnerability arises from improper integer handling when processing extended attribute list sizes, leading to integer overflow conditions that can cause memory corruption and potential information disclosure.
Critical Impact
Local attackers with low privileges can exploit this vulnerability to read sensitive kernel memory or cause a denial of service condition through slab-out-of-bounds memory access.
Affected Products
- Linux Kernel (multiple versions with JFS support)
- Debian Linux (LTS releases)
- Systems using JFS filesystem with extended attributes enabled
Discovery Timeline
- April 18, 2025 - CVE-2025-39735 published to NVD
- November 3, 2025 - Last updated in NVD database
Technical Details for CVE-2025-39735
Vulnerability Analysis
The vulnerability exists in the ea_get() function within the JFS filesystem implementation. When processing extended attributes, the function performs a size validation check at the size_check label. During this validation, EALIST_SIZE(ea_buf->xattr) can return values exceeding INT_MAX (2,147,483,647). The code attempts to clamp the ea_size value using clamp_t(int, ea_size, 0, EALIST_SIZE(ea_buf->xattr)), but because the upper bound exceeds the signed integer maximum, an integer overflow occurs.
When the overflow causes the size variable to become negative (e.g., -184549328), this value is then passed to print_hex_dump() as a size_t parameter, which interprets the negative value as a very large unsigned number (18446744073525002176). This corrupted length value causes the subsequent for loop in print_hex_dump() to iterate far beyond the actual buffer boundaries, resulting in out-of-bounds memory reads in hex_dump_to_buffer().
Root Cause
The root cause is insufficient validation of the EALIST_SIZE(ea_buf->xattr) value before it is used in integer operations. The clamp_t() macro performs type coercion that truncates values larger than INT_MAX, causing signed integer overflow when the extended attribute list size exceeds 2^31-1 bytes. This overflow propagates through the error handling path, ultimately corrupting the length parameter used in memory dump operations.
Attack Vector
An attacker with local access and low privileges can exploit this vulnerability by creating or manipulating a JFS filesystem with crafted extended attributes containing specially constructed size values. The attack requires local system access and the ability to mount or access JFS filesystems. When the kernel attempts to process these malformed extended attributes, the integer overflow triggers during error handling, leading to out-of-bounds memory reads.
The exploitation flow involves:
- Crafting a JFS filesystem image with extended attributes where EALIST_SIZE returns a value exceeding INT_MAX
- Mounting or accessing the malicious filesystem
- Triggering the ea_get() function to process the corrupted extended attributes
- The size validation failure triggers the error path with print_hex_dump()
- The overflow causes reading beyond allocated slab memory boundaries
Detection Methods for CVE-2025-39735
Indicators of Compromise
- Kernel log messages containing "ea_get: invalid extended attribute" followed by unusually large hex dumps
- KASAN (Kernel Address Sanitizer) reports indicating slab-out-of-bounds reads in hex_dump_to_buffer()
- System instability or crashes when accessing JFS filesystems with extended attributes
Detection Strategies
- Enable KASAN in kernel builds to detect out-of-bounds memory accesses in development and testing environments
- Monitor kernel logs (dmesg) for JFS-related error messages, particularly those involving extended attribute processing
- Implement file integrity monitoring on systems using JFS to detect filesystem corruption or manipulation
Monitoring Recommendations
- Deploy kernel runtime integrity monitoring solutions such as SentinelOne Singularity to detect anomalous kernel behavior
- Configure audit logging for JFS mount operations and extended attribute access on critical systems
- Use kernel trace points to monitor ea_get() function calls and detect unusual parameter values
How to Mitigate CVE-2025-39735
Immediate Actions Required
- Update the Linux kernel to a patched version as soon as available for your distribution
- Consider migrating critical data from JFS to alternative filesystems (ext4, XFS) if patching is not immediately possible
- Restrict access to JFS filesystem mounting on multi-user systems
- Apply available vendor patches from Debian and other Linux distributions
Patch Information
Multiple patches have been released across various kernel stable branches. The fix validates EALIST_SIZE(ea_buf->xattr) before it is used in the clamp_t() operation, preventing the integer overflow condition. Key patch commits include:
- Kernel Commit 0beddc2
- Kernel Commit 16d3d36
- Kernel Commit 3d6fd5b
- Kernel Commit 46e2c03
- Kernel Commit 50afcee
Debian has released security updates via Debian LTS Announcement and additional Debian LTS update.
Workarounds
- Disable JFS filesystem support by blacklisting the jfs kernel module (echo "blacklist jfs" >> /etc/modprobe.d/blacklist.conf)
- Restrict mount capabilities using Linux Security Modules (SELinux, AppArmor) to prevent untrusted users from mounting JFS filesystems
- If JFS must be used, disable extended attribute support by mounting with the noattr2 option where supported
# Blacklist JFS kernel module to prevent loading
echo "blacklist jfs" >> /etc/modprobe.d/jfs-blacklist.conf
modprobe -r jfs
# Alternatively, restrict JFS mounting via fstab options
# Add nouser,noexec options to JFS mount entries
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.


