[BACKPORT 6.18.y] ntfs3: fix OOB write in attr_wof_frame_info()

From: まだ春を待つ

Date: Sun Dec 06 2026 - 04:35:37 EST


The upstream fix 859d777646b5 ("ntfs3: fix OOB write in
attr_wof_frame_info()") is present in 7.1+ but not in 6.18.66/6.12.120.

A crafted NTFS image with WofCompressedData.nres.data_size=0xfff and a
file large enough to request frame 1024 (offset 0x400000) makes
attr_wof_frame_info() compute from=0x1000, to=0xfff. The unsigned
(to - from) wraps to 0xffffffffffffffff and ntfs_read_write_run()
overflows the single-page offs_folio.

Reproduced on 6.18.66 with KASAN:

BUG: KASAN: slab-use-after-free in ntfs_read_write_run+0x346/0x490
Write of size 4096 at addr ffff888006a0c000 by task wof_read/976
...
attr_wof_frame_info+0x65b/0x9b0
ni_read_frame+0x4ea/0xcd0
ksys_pread64+0x111/0x150

The same image on 7.3.7 returns -EIO and logs
"ntfs3(loop0): ino=40, \"trigger\" attr_wof_frame_info", with no KASAN.

Please consider backporting 859d777646b5 to 6.18.y and 6.12.y.
Reproducer image and static pread helper are available on request.

Thanks,
kkU1444
1691565877@xxxxxx

Attachment: WOF-repro-scripts-20261206.zip
Description: Binary data

Attachment: KASAN-WOF-20261206.txt
Description: Binary data

Attachment: SHA256SUMS
Description: Binary data