CVE-2026-139258

ntfs: widen the sub-block offsets in ntfs_decompress()

Published Nov 30, 2026 CVSS 3.1 · 7.8 High EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

ntfs: widen the sub-block offsets in ntfs_decompress()

ntfs_decompress() tracks where the current sub-block starts and ends
inside the destination page with two u16s:

u16 do_sb_start;
u16 do_sb_end;
...
do_sb_start = *dest_ofs;
do_sb_end = do_sb_start + NTFS_SB_SIZE;

*dest_ofs is an int page offset masked with ~PAGE_MASK, and
NTFS_SB_SIZE is 0x1000, so do_sb_end needs PAGE_SIZE + 0xfff of range.
That exceeds u16 once PAGE_SIZE reaches 0x10000: the last sub-block of a
page starts at 0xf000 and do_sb_end wraps from 0x10000 to 0.

The zero-fill that pads a short sub-block then computes a negative
length:

if (dp_addr < dp_sb_end) {
int nr_bytes = do_sb_end - *dest_ofs;

memset(dp_addr, 0, nr_bytes);

A sub-block made only of symbol tokens reaches this without consulting
do_sb_end on the way, because that path just does

*dp_addr++ = *cb++;
++*dest_ofs;

and is bounded by dp_addr against dp_sb_end. With do_sb_start at 0xf000
and eight literal bytes emitted, nr_bytes is -61448 and the memset()
runs for 18446744073709490168 bytes.

Getting there is cheap: fifteen sub-blocks of eleven bytes each advance
*dest_ofs to 0xf000, since the same zero-fill pads each of them out to
0x1000 while do_sb_end is still exact, and the sixteenth one triggers
the wrap. A compression block is 0x10000 bytes with 4 KiB clusters and
the fixed compression unit of 4, so all sixteen fit with room to spare.

Phrase tokens are bounded against do_sb_end and so return -EOVERFLOW
instead, and the

if (*dest_index == dest_max_index && do_sb_end > dest_max_ofs)

check at the top of the sub-block stops firing for the same reason.

Use int for both, matching *dest_ofs and dest_max_ofs. The narrow type
came in with the original import and survived the removal and revert of
the driver.

Analysis

AI-generated

Technical impact

The vulnerability resides in the NTFS filesystem driver of the Linux kernel. Two 16‑bit counters that track the start and end of a compression sub‑block overflow when the page size exceeds 64 KiB. The overflow causes the end marker to wrap to zero, leading to a negative length computation for a memset operation. The oversized memset writes an astronomical number of bytes into kernel memory, corrupting data structures and typically crashing the kernel. If the overwritten memory region includes executable code pointers or other control data, the fault could allow an attacker to execute arbitrary code with kernel privileges.

Affected Systems

All Linux kernel releases that ship the NTFS driver and have not applied the upstream patch are affected. The change was incorporated into the kernel via commit 389ab01cff8a352c46cb137ef382d5eab4c0bbf9 and later retain the fix. Because the vendor identification lists "Linux:Linux", any distribution using a kernel that bundles the NTFS filesystem and has not yet upgraded is at risk. No specific distribution or kernel version numbers are enumerated in the supplied data.

Risk and Exploitability

The flaw exposes kernel memory to uncontrolled writes, a flaw that is classified as highly critical. Based on the description, it is inferred that the attack vector involves delivering a malformed compressed NTFS file that triggers decompression; attackers can trigger it by feeding the kernel a specially crafted compressed NTFS file. Since the NTFS driver operates with full privileged context, any user that can read a malicious file from an NTFS volume can potentially cause a system crash or execute code in the kernel address space. The lack of an EPSS score and its absence from the CISA KEV catalog suggests the attack has not yet been observed in the wild, but the nature of the bug warrants prompt remediation.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the kernel to a version that incorporates commit 389ab01cff8a352c46cb137ef382d5eab4c0bbf9 or later, which fixes the overflow in ntfs_decompress().
  • If an immediate kernel upgrade is not feasible, disable NTFS filesystem support by removing CONFIG_NTFS from the kernel configuration or unloading the ntfs module when it is not required.
  • Limit access to NTFS partitions by mounting them only from trusted devices and using read‑only mounts whenever possible, reducing the likelihood that a malicious compressed file can be processed.

Generated by OpenCVE AI on December 1, 2026 at 07:47 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-122
CWE-190
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: ntfs: widen the sub-block offsets in ntfs_decompress() ntfs_decompress() tracks where the current sub-block starts and ends inside the destination page with two u16s: u16 do_sb_start; u16 do_sb_end; ... do_sb_start = *dest_ofs; do_sb_end = do_sb_start + NTFS_SB_SIZE; *dest_ofs is an int page offset masked with ~PAGE_MASK, and NTFS_SB_SIZE is 0x1000, so do_sb_end needs PAGE_SIZE + 0xfff of range. That exceeds u16 once PAGE_SIZE reaches 0x10000: the last sub-block of a page starts at 0xf000 and do_sb_end wraps from 0x10000 to 0. The zero-fill that pads a short sub-block then computes a negative length: if (dp_addr < dp_sb_end) { int nr_bytes = do_sb_end - *dest_ofs; memset(dp_addr, 0, nr_bytes); A sub-block made only of symbol tokens reaches this without consulting do_sb_end on the way, because that path just does *dp_addr++ = *cb++; ++*dest_ofs; and is bounded by dp_addr against dp_sb_end. With do_sb_start at 0xf000 and eight literal bytes emitted, nr_bytes is -61448 and the memset() runs for 18446744073709490168 bytes. Getting there is cheap: fifteen sub-blocks of eleven bytes each advance *dest_ofs to 0xf000, since the same zero-fill pads each of them out to 0x1000 while do_sb_end is still exact, and the sixteenth one triggers the wrap. A compression block is 0x10000 bytes with 4 KiB clusters and the fixed compression unit of 4, so all sixteen fit with room to spare. Phrase tokens are bounded against do_sb_end and so return -EOVERFLOW instead, and the if (*dest_index == dest_max_index && do_sb_end > dest_max_ofs) check at the top of the sub-block stops firing for the same reason. Use int for both, matching *dest_ofs and dest_max_ofs. The narrow type came in with the original import and survived the removal and revert of the driver.
Title ntfs: widen the sub-block offsets in ntfs_decompress()
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-122

    Heap-based Buffer Overflow

  • CWE-190

    Integer Overflow or Wraparound

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Dec 1, 2026, 5:42 AM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:18 PM
Modified
Dec 1, 2026, 6:17 AM