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

Published Nov 30, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

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

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

u16 dosbstart; u16 dosbend; ... dosbstart = destofs; dosbend = dosbstart + NTFSSBSIZE;

destofs is an int page offset masked with ~PAGEMASK, and NTFSSBSIZE is 0x1000, so dosbend needs PAGESIZE + 0xfff of range. That exceeds u16 once PAGESIZE reaches 0x10000: the last sub-block of a page starts at 0xf000 and dosbend wraps from 0x10000 to 0.

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

if (dpaddr < dpsbend) { int nrbytes = dosbend - destofs;

memset(dpaddr, 0, nrbytes);

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

dpaddr++ = cb++; ++destofs;

and is bounded by dpaddr against dpsbend. With dosbstart at 0xf000 and eight literal bytes emitted, nrbytes is -61448 and the memset() runs for 18446744073709490168 bytes.

Getting there is cheap: fifteen sub-blocks of eleven bytes each advance destofs to 0xf000, since the same zero-fill pads each of them out to 0x1000 while dosbend 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 dosbend and so return -EOVERFLOW instead, and the

if (destindex == destmaxindex && dosbend > destmaxofs)

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

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

Affected Software

1 affected component
Linux Linux kernel

Event History

Nov 30, 2026
CVE Published
via MITRE·01:33 PM
Data Sourced
via MITRE·01:33 PM
Description

Frequently Asked Questions

1

Which systems are exposed to the offset wraparound?

The overflow condition requires a kernel page size of at least 0x10000 (64 KiB). On such systems, the final 0x1000-byte NTFS sub-block in a page can cause the 16-bit end offset to wrap to zero.

2

What input is needed to trigger the oversized write?

An attacker needs compressed NTFS data arranged to advance the destination offset to 0xf000 and then emit a short sub-block through the symbol-token path. The described example uses fifteen 11-byte sub-blocks followed by eight literal bytes, causing a negative zero-fill length that becomes a very large memset size.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203