Re: [PATCH v2] ntfs: guard the final LZNT1 sub-block header read

From: Namjae Jeon

Date: Thu Nov 26 2026 - 00:09:25 EST


On Wed, Nov 25, 2026 at 5:50 PM shaos <shawnq1@xxxxxxx> wrote:
>
> The legacy NTFS LZNT1 decompressor reads a 16-bit sub-block header
> before checking that the full header remains in the compression
> buffer. If only one byte remains, the read crosses the end of the
> 64 KiB buffer.
>
> Return -EOVERFLOW for an incomplete header while preserving successful
> termination when the buffer is exactly exhausted. Validate phrase-token
> length against the sub-block boundary before reading it.
>
> Tested on x86-64 with QEMU. The original header-boundary reproducer
> and a phrase-token boundary reproducer no longer fault; both malformed
> streams are rejected with -EOVERFLOW. The one-byte control still
> returns byte 'A'.
>
> Fixes: 1e9ea7e04472 ("Revert "fs: Remove NTFS classic"")
> Signed-off-by: shaos <shawnq1@xxxxxxx>
Please tell me your real name so I can use it in the Signed-off-by line.
Thanks.