{"id":"CVE-2026-99862","summary":"fs/ntfs3: bound DeleteAttribute asize against rec-\u003eused in do_action","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nfs/ntfs3: bound DeleteAttribute asize against rec-\u003eused in do_action\n\nIn do_action()'s DeleteAttribute case (fslog.c:3316), attr is\nAdd2Ptr(rec, roff) with roff taken from the on-disk lrh-\u003erecord_off, and\nasize = le32_to_cpu(attr-\u003esize) is read straight out of the MFT record:\n\n\tasize = le32_to_cpu(attr-\u003esize);\n\tused  = le32_to_cpu(rec-\u003eused);\n\n\tif (!check_if_attr(rec, lrh))\n\t\tgoto dirty_vol;\n\t...\n\tmemmove(attr, Add2Ptr(attr, asize), used - asize - roff);\n\ncheck_if_attr() (fslog.c:2869) walks the attribute chain from\nrec-\u003eattr_off and returns o == ro.  Its loop breaks on ATTR_END, so ro may\nlegitimately equal the offset of the ATTR_END marker; that is exactly how\nCreateAttribute appends to a record.  But check_file_record()'s walk\n(fslog.c:2831) also stops at ATTR_END, so check_attr() never inspects the\nbytes there.  When roff is the ATTR_END offset, those never-validated bytes\nare what gets read as attr-\u003esize, and used - asize - roff underflows.\n\nThe read itself is also unbounded: roff is a u16 and attr-\u003esize is\ndereferenced at fslog.c:3317, before check_if_attr() has constrained roff\nat all, so it can be up to ~64K past a record_size-sized object.\n\nCommit 0ca0485e4b2e (\"fs/ntfs3: validate rec-\u003eused in journal-replay file\nrecord check\") added at fslog.c:2844\n\n\tif (used \u003c PtrOffset(rec, attr) + sizeof(attr-\u003etype))\n\t\treturn false;\n\nand its changelog names this very memmove.  It bounds rec-\u003eused against the\nATTR_END offset; it does not bound asize.  With record_size 0x400,\nattr_off 0x38, a valid three-attribute chain ending in ATTR_END at 0x158\nand used 0x160, a record whose four bytes at 0x15c read 0x100 gives\n\n\tused - asize - roff = 0x160 - 0x100 - 0x158 = 0xffffff08\n\ni.e. a ~4 GiB memmove whose source and destination both run off the end of\nrec, a kmalloc(sbi-\u003erecord_size) object (record.c:105).\n\nThe equivalent non-replay path already refuses this.  mi_remove_attr()\nperforms the same removal and starts with (record.c:548):\n\n\tif (aoff + asize \u003e used)\n\t\treturn false;\n\nApply the same bound, spelled as a subtraction to match the neighbouring\ncases, and move the attr-\u003esize read after check_if_attr() so that the\nheader is known to lie inside the record before it is dereferenced.\nRequiring roff + SIZEOF_RESIDENT \u003c= used rejects the ATTR_END offset\nwithout rejecting any real attribute: for an attribute the walk validated,\nroff + asize \u003c= off(ATTR_END) \u003c= used - 4, and any attribute a\nDeleteAttribute record can legitimately name carries a full resident\nheader, so roff + SIZEOF_RESIDENT \u003c= roff + asize \u003c= used - 4.\ncheck_attr() itself imposes no lower bound on asize, so a crafted\nsub-header asize can still pass the first test; the second test then\nbounds it and the memmove stays inside the record.\n\nReproduced by mounting a crafted image on v7.2-rc5, which already contains\n0ca0485e4b2e, under KASAN.  The image is an ordinary mkfs.ntfs volume with\nfour bytes of one MFT record changed and a crafted $LogFile:\n\n  BUG: KASAN: slab-out-of-bounds in do_action.isra.0+0x3211/0x83c0\n  Read of size 4294967048 at addr ffff888002423258 by task mount/66\n\n  CPU: 1 UID: 0 PID: 66 Comm: mount Not tainted 7.2.0-rc5 #3\n  Call Trace:\n   kasan_report+0xce/0x100\n   kasan_check_range+0x105/0x1b0\n   __asan_memmove+0x23/0x60\n   do_action.isra.0+0x3211/0x83c0\n   log_replay+0x920a/0xd300\n   ntfs_loadlog_and_replay+0x3ef/0x510\n   ntfs_fill_super+0x1d23/0x4550\n   get_tree_bdev_flags+0x2ef/0x550\n   vfs_get_tree+0x82/0x2f0\n   fc_mount+0x10/0x1b0\n   path_mount+0x517/0x1df0\n   __x64_sys_mount+0x20b/0x270\n   do_syscall_64+0xf9/0x540\n   entry_SYSCALL_64_after_hwframe+0x77/0x7f\n\n  Allocated by task 66:\n   __kasan_kmalloc+0x8f/0xa0\n   __kmalloc_noprof+0x1b4/0x460\n   mi_init+0x81/0x110\n   mi_get+0x6a/0x220\n   do_action.isra.0+0x1dbf/0x83c0\n   log_replay+0x920a/0xd300\n   ntfs_loadlog_and_replay+0x3ef/0x510\n   ntfs_fill_super+0x1d23/0x4550\n\n  The buggy address belongs to the object at ffff88\n---truncated---","modified":"2026-12-01T07:00:44.590766455Z","published":"2026-11-30T13:17:45.277Z","database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99862.json","cna_assigner":"Linux"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/408216b66afd9ddadaba2dce56fd4af6793e95a2"},{"type":"WEB","url":"https://git.kernel.org/stable/c/61329755f28185322ab4f7640112b1e5c2f505ee"},{"type":"WEB","url":"https://git.kernel.org/stable/c/7e1d4096436edfb365c536ca92d5db8e507add9c"},{"type":"WEB","url":"https://git.kernel.org/stable/c/81e354bc1e5568fd56ebe1caf1a828df67294d93"},{"type":"WEB","url":"https://git.kernel.org/stable/c/986ec1c317d15cb8040d82471190e5fb209a564e"},{"type":"WEB","url":"https://git.kernel.org/stable/c/c9544b9a24a60d5eb3fedd7765ac741f1f0bf191"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e558ee689f40b4d4e8d46d7a76c1c4e439f11200"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99862.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99862"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"b46acd6a6a627d876898e1c84d3f84902264b445"},{"fixed":"c9544b9a24a60d5eb3fedd7765ac741f1f0bf191"},{"fixed":"7e1d4096436edfb365c536ca92d5db8e507add9c"},{"fixed":"986ec1c317d15cb8040d82471190e5fb209a564e"},{"fixed":"e558ee689f40b4d4e8d46d7a76c1c4e439f11200"},{"fixed":"61329755f28185322ab4f7640112b1e5c2f505ee"},{"fixed":"81e354bc1e5568fd56ebe1caf1a828df67294d93"},{"fixed":"408216b66afd9ddadaba2dce56fd4af6793e95a2"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-99862.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.15.0"},{"fixed":"5.15.226"}]},{"type":"ECOSYSTEM","events":[{"introduced":"5.16.0"},{"fixed":"6.1.193"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.0"},{"fixed":"6.6.163"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.117"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.18.63"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-99862.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"}]}