{"api_version":"1","generated_at":"2026-12-01T06:50:15+00:00","cve":"CVE-2026-99863","urls":{"html":"https://cve.report/CVE-2026-99863","api":"https://cve.report/api/cve/CVE-2026-99863.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-99863","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-99863"},"summary":{"title":"fs/ntfs3: bound CreateAttribute asize against record_size in do_action","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nfs/ntfs3: bound CreateAttribute asize against record_size in do_action\n\nIn do_action()'s CreateAttribute case (fslog.c:3286), attr2 points into\nthe on-disk log record and asize = le32_to_cpu(attr2->size) is therefore\nattacker-controlled on mount.  The guard bounds asize only against the\nlog record itself,\n\n\tAdd2Ptr(attr2, asize) > Add2Ptr(lrh, rec_len)\n\nwhere rec_len is the client data length, and separately bounds dlen\nagainst the MFT record.  Nothing bounds asize against record_size, but\nall three writes that follow are into rec, a kmalloc(sbi->record_size)\nbuffer allocated by mi_init() (record.c:105):\n\n\tmemmove(Add2Ptr(attr, asize), attr, used - roff);\n\tmemcpy(attr, attr2, asize);\n\trec->used = cpu_to_le32(used + asize);\n\nWith record_size 0x400, roff 0x38, used 0x160 and asize 0x800 the memcpy\nwrites 2048 bytes at rec + 0x38, 0x438 bytes past the allocation, and\nrec->used is left at 0x960.  dlen is 0x18 here, so the existing\ndlen check passes: dlen bounds nothing about the size of the copy.\n\nThe equivalent non-replay path already refuses this.  mi_insert_attr()\nperforms the same insert and starts with (record.c:488):\n\n\tif (used + asize > sbi->record_size)\n\t\treturn NULL;\n\nApply the same bound, spelled as a subtraction to match the neighbouring\nclause.  used <= record_size holds here because check_file_record()\nvalidates it (fslog.c:2826) and is called on this record at fslog.c:3172;\nroff <= used - 4 follows from check_if_attr() together with the ATTR_END\ncheck at fslog.c:2844, so bounding used + asize bounds both copies.\n\nThe sibling WriteEndOfFileRecordSegment case does the equivalent check\nagainst record_size at fslog.c:3277.\n\nReproduced by mounting a crafted image on v7.2-rc5 under KASAN:\n\n  BUG: KASAN: slab-out-of-bounds in do_action.isra.0+0x41f6/0x83a0\n  Write of size 2048 at addr ffff888005c74838 by task mount/69\n\n  CPU: 0 UID: 0 PID: 69 Comm: mount Not tainted 7.2.0-rc5-00300-g8ba098e6b6ff #2\n  Call Trace:\n   kasan_report+0xce/0x100\n   kasan_check_range+0x105/0x1b0\n   __asan_memcpy+0x3c/0x60\n   do_action.isra.0+0x41f6/0x83a0\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 69:\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+0x1db4/0x83a0\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 ffff888005c74800\n   which belongs to the cache kmalloc-1k of size 1024\n  The buggy address is located 56 bytes inside of\n   allocated 1024-byte region [ffff888005c74800, ffff888005c74c00)","state":"PUBLISHED","assigner":"Linux","published_at":"2026-11-30 14:20:20","updated_at":"2026-12-01 06:17:54"},"problem_types":[],"metrics":[{"version":"3.1","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","type":"Secondary","score":"7.8","severity":"HIGH","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","data":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH","attackVector":"LOCAL","attackComplexity":"LOW","privilegesRequired":"NONE","userInteraction":"REQUIRED","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"HIGH"}},{"version":"3.1","source":"CNA","type":"DECLARED","score":"7.8","severity":"HIGH","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","data":{"baseScore":7.8,"baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","version":"3.1"}}],"references":[{"url":"https://git.kernel.org/stable/c/f2cdd82f1dc242e6f831e9cf580eeb5db4af0b5f","name":"https://git.kernel.org/stable/c/f2cdd82f1dc242e6f831e9cf580eeb5db4af0b5f","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/eb2c69866e1883e00f553127f40df01e9891164e","name":"https://git.kernel.org/stable/c/eb2c69866e1883e00f553127f40df01e9891164e","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/becddb2e2b856210ce34654261e27d233dfa904b","name":"https://git.kernel.org/stable/c/becddb2e2b856210ce34654261e27d233dfa904b","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/fb0f0ef7b5a6bc761b372ce00764d4b6e0b91a47","name":"https://git.kernel.org/stable/c/fb0f0ef7b5a6bc761b372ce00764d4b6e0b91a47","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/2ebe4f0736129014d6fc475215fc5bf0a0549737","name":"https://git.kernel.org/stable/c/2ebe4f0736129014d6fc475215fc5bf0a0549737","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/0ea0755124dba3c9682a87adcee8b4b3ab57902f","name":"https://git.kernel.org/stable/c/0ea0755124dba3c9682a87adcee8b4b3ab57902f","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://git.kernel.org/stable/c/119ab8d9dd61c24a604be6175dc658cebb3a3bbd","name":"https://git.kernel.org/stable/c/119ab8d9dd61c24a604be6175dc658cebb3a3bbd","refsource":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-99863","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99863","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected b46acd6a6a627d876898e1c84d3f84902264b445 eb2c69866e1883e00f553127f40df01e9891164e git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected b46acd6a6a627d876898e1c84d3f84902264b445 f2cdd82f1dc242e6f831e9cf580eeb5db4af0b5f git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected b46acd6a6a627d876898e1c84d3f84902264b445 becddb2e2b856210ce34654261e27d233dfa904b git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected b46acd6a6a627d876898e1c84d3f84902264b445 0ea0755124dba3c9682a87adcee8b4b3ab57902f git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected b46acd6a6a627d876898e1c84d3f84902264b445 2ebe4f0736129014d6fc475215fc5bf0a0549737 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected b46acd6a6a627d876898e1c84d3f84902264b445 119ab8d9dd61c24a604be6175dc658cebb3a3bbd git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected b46acd6a6a627d876898e1c84d3f84902264b445 fb0f0ef7b5a6bc761b372ce00764d4b6e0b91a47 git","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"affected 5.15","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.15 semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 5.15.226 5.15.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.1.193 6.1.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.6.163 6.6.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.12.117 6.12.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 6.18.63 6.18.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.3.4 7.3.* semver","platforms":[]},{"source":"CNA","vendor":"Linux","product":"Linux","version":"unaffected 7.4-rc1 * original_commit_for_fix","platforms":[]}],"timeline":[],"solutions":[],"workarounds":[],"exploits":[],"credits":[],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"cna":{"affected":[{"defaultStatus":"unaffected","product":"Linux","programFiles":["fs/ntfs3/fslog.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"lessThan":"eb2c69866e1883e00f553127f40df01e9891164e","status":"affected","version":"b46acd6a6a627d876898e1c84d3f84902264b445","versionType":"git"},{"lessThan":"f2cdd82f1dc242e6f831e9cf580eeb5db4af0b5f","status":"affected","version":"b46acd6a6a627d876898e1c84d3f84902264b445","versionType":"git"},{"lessThan":"becddb2e2b856210ce34654261e27d233dfa904b","status":"affected","version":"b46acd6a6a627d876898e1c84d3f84902264b445","versionType":"git"},{"lessThan":"0ea0755124dba3c9682a87adcee8b4b3ab57902f","status":"affected","version":"b46acd6a6a627d876898e1c84d3f84902264b445","versionType":"git"},{"lessThan":"2ebe4f0736129014d6fc475215fc5bf0a0549737","status":"affected","version":"b46acd6a6a627d876898e1c84d3f84902264b445","versionType":"git"},{"lessThan":"119ab8d9dd61c24a604be6175dc658cebb3a3bbd","status":"affected","version":"b46acd6a6a627d876898e1c84d3f84902264b445","versionType":"git"},{"lessThan":"fb0f0ef7b5a6bc761b372ce00764d4b6e0b91a47","status":"affected","version":"b46acd6a6a627d876898e1c84d3f84902264b445","versionType":"git"}]},{"defaultStatus":"affected","product":"Linux","programFiles":["fs/ntfs3/fslog.c"],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","vendor":"Linux","versions":[{"status":"affected","version":"5.15"},{"lessThan":"5.15","status":"unaffected","version":"0","versionType":"semver"},{"lessThanOrEqual":"5.15.*","status":"unaffected","version":"5.15.226","versionType":"semver"},{"lessThanOrEqual":"6.1.*","status":"unaffected","version":"6.1.193","versionType":"semver"},{"lessThanOrEqual":"6.6.*","status":"unaffected","version":"6.6.163","versionType":"semver"},{"lessThanOrEqual":"6.12.*","status":"unaffected","version":"6.12.117","versionType":"semver"},{"lessThanOrEqual":"6.18.*","status":"unaffected","version":"6.18.63","versionType":"semver"},{"lessThanOrEqual":"7.3.*","status":"unaffected","version":"7.3.4","versionType":"semver"},{"lessThanOrEqual":"*","status":"unaffected","version":"7.4-rc1","versionType":"original_commit_for_fix"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"5.15.226","versionStartIncluding":"5.15","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.1.193","versionStartIncluding":"5.15","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.6.163","versionStartIncluding":"5.15","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.12.117","versionStartIncluding":"5.15","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"6.18.63","versionStartIncluding":"5.15","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.3.4","versionStartIncluding":"5.15","vulnerable":true},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionEndExcluding":"7.4-rc1","versionStartIncluding":"5.15","vulnerable":true}],"negate":false,"operator":"OR"}]}],"descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nfs/ntfs3: bound CreateAttribute asize against record_size in do_action\n\nIn do_action()'s CreateAttribute case (fslog.c:3286), attr2 points into\nthe on-disk log record and asize = le32_to_cpu(attr2->size) is therefore\nattacker-controlled on mount.  The guard bounds asize only against the\nlog record itself,\n\n\tAdd2Ptr(attr2, asize) > Add2Ptr(lrh, rec_len)\n\nwhere rec_len is the client data length, and separately bounds dlen\nagainst the MFT record.  Nothing bounds asize against record_size, but\nall three writes that follow are into rec, a kmalloc(sbi->record_size)\nbuffer allocated by mi_init() (record.c:105):\n\n\tmemmove(Add2Ptr(attr, asize), attr, used - roff);\n\tmemcpy(attr, attr2, asize);\n\trec->used = cpu_to_le32(used + asize);\n\nWith record_size 0x400, roff 0x38, used 0x160 and asize 0x800 the memcpy\nwrites 2048 bytes at rec + 0x38, 0x438 bytes past the allocation, and\nrec->used is left at 0x960.  dlen is 0x18 here, so the existing\ndlen check passes: dlen bounds nothing about the size of the copy.\n\nThe equivalent non-replay path already refuses this.  mi_insert_attr()\nperforms the same insert and starts with (record.c:488):\n\n\tif (used + asize > sbi->record_size)\n\t\treturn NULL;\n\nApply the same bound, spelled as a subtraction to match the neighbouring\nclause.  used <= record_size holds here because check_file_record()\nvalidates it (fslog.c:2826) and is called on this record at fslog.c:3172;\nroff <= used - 4 follows from check_if_attr() together with the ATTR_END\ncheck at fslog.c:2844, so bounding used + asize bounds both copies.\n\nThe sibling WriteEndOfFileRecordSegment case does the equivalent check\nagainst record_size at fslog.c:3277.\n\nReproduced by mounting a crafted image on v7.2-rc5 under KASAN:\n\n  BUG: KASAN: slab-out-of-bounds in do_action.isra.0+0x41f6/0x83a0\n  Write of size 2048 at addr ffff888005c74838 by task mount/69\n\n  CPU: 0 UID: 0 PID: 69 Comm: mount Not tainted 7.2.0-rc5-00300-g8ba098e6b6ff #2\n  Call Trace:\n   kasan_report+0xce/0x100\n   kasan_check_range+0x105/0x1b0\n   __asan_memcpy+0x3c/0x60\n   do_action.isra.0+0x41f6/0x83a0\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 69:\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+0x1db4/0x83a0\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 ffff888005c74800\n   which belongs to the cache kmalloc-1k of size 1024\n  The buggy address is located 56 bytes inside of\n   allocated 1024-byte region [ffff888005c74800, ffff888005c74c00)"}],"metrics":[{"cvssV3_1":{"baseScore":7.8,"baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","version":"3.1"},"scenarios":[{"lang":"en","value":"AV:L - The malformed input is a CreateAttribute redo record (attr2->size and its payload) stored in $LogFile on an NTFS image. log_replay() consumes it in do_action() during mount(2), via ntfs_fill_super() then ntfs_loadlog_and_replay(). No network protocol carries these bytes; the image arrives as a local file, a loop device or attached media.\nAC:L - Everything the redo pass needs is in the attacker's image: non-empty dirty page and open-attribute tables, a non-sparse target_vcn, and an MFT record passing check_file_record() and check_if_attr(). The overflow then fires deterministically on mount, as the KASAN reproduction in the commit shows.\nPR:N - The attacker needs no account on the target and only supplies the image. ntfs3's fs_flags are FS_REQUIRES_DEV|FS_ALLOW_IDMAP with no FS_USERNS_MOUNT, so the mount itself needs init-namespace CAP_SYS_ADMIN or an automounter acting for the victim. That is scored as user interaction, not as attacker privilege.\nUI:R - A victim, or an automounter acting for them, must mount the crafted volume read-write. log_replay() does 'if (is_ro) goto out' before the redo pass, so a read-only mount never reaches the CreateAttribute case of do_action().\nS:U - The corruption stays in the kernel heap of the host doing the mount. It does not cross a guest/host, IOMMU or other security-authority boundary.\nC:H - memmove(attr+asize, attr, used-roff) and memcpy(attr, attr2, asize) write past the kmalloc(record_size) buffer from mi_init() (kmalloc-1k for 1K records). Overwriting neighbouring slab objects with controlled content can be groomed into kernel memory disclosure.\nI:H - asize is bounded only by the log record length rec_len, never by record_size. Up to kilobytes of attacker-chosen $LogFile bytes are written linearly past the MFT record buffer into adjacent slab objects (KASAN: 2048-byte write at offset 0x38). This is an exploitable heap overflow that can lead to code execution.\nA:H - Even without exploitation, the overflow corrupts adjacent kmalloc-1k objects and sets rec->used beyond record_size, which leads to an oops or panic during mount or on later use of the corrupted objects."}]}],"providerMetadata":{"dateUpdated":"2026-12-01T05:43:54.012Z","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","shortName":"Linux"},"references":[{"url":"https://git.kernel.org/stable/c/eb2c69866e1883e00f553127f40df01e9891164e"},{"url":"https://git.kernel.org/stable/c/f2cdd82f1dc242e6f831e9cf580eeb5db4af0b5f"},{"url":"https://git.kernel.org/stable/c/becddb2e2b856210ce34654261e27d233dfa904b"},{"url":"https://git.kernel.org/stable/c/0ea0755124dba3c9682a87adcee8b4b3ab57902f"},{"url":"https://git.kernel.org/stable/c/2ebe4f0736129014d6fc475215fc5bf0a0549737"},{"url":"https://git.kernel.org/stable/c/119ab8d9dd61c24a604be6175dc658cebb3a3bbd"},{"url":"https://git.kernel.org/stable/c/fb0f0ef7b5a6bc761b372ce00764d4b6e0b91a47"}],"title":"fs/ntfs3: bound CreateAttribute asize against record_size in do_action","x_generator":{"engine":"bippy-1.2.0"}}},"cveMetadata":{"assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","assignerShortName":"Linux","cveId":"CVE-2026-99863","datePublished":"2026-11-30T13:17:45.857Z","dateReserved":"2026-09-25T10:25:14.439Z","dateUpdated":"2026-12-01T05:43:54.012Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-11-30 14:20:20","lastModifiedDate":"2026-12-01 06:17:54","problem_types":[],"metrics":{"cvssMetricV31":[{"source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","type":"Secondary","cvssData":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH","attackVector":"LOCAL","attackComplexity":"LOW","privilegesRequired":"NONE","userInteraction":"REQUIRED","scope":"UNCHANGED","confidentialityImpact":"HIGH","integrityImpact":"HIGH","availabilityImpact":"HIGH"},"exploitabilityScore":1.8,"impactScore":5.9}]},"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"99863","Ordinal":"1","Title":"fs/ntfs3: bound CreateAttribute asize against record_size in do_","CVE":"CVE-2026-99863","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"99863","Ordinal":"1","NoteData":"In the Linux kernel, the following vulnerability has been resolved:\n\nfs/ntfs3: bound CreateAttribute asize against record_size in do_action\n\nIn do_action()'s CreateAttribute case (fslog.c:3286), attr2 points into\nthe on-disk log record and asize = le32_to_cpu(attr2->size) is therefore\nattacker-controlled on mount.  The guard bounds asize only against the\nlog record itself,\n\n\tAdd2Ptr(attr2, asize) > Add2Ptr(lrh, rec_len)\n\nwhere rec_len is the client data length, and separately bounds dlen\nagainst the MFT record.  Nothing bounds asize against record_size, but\nall three writes that follow are into rec, a kmalloc(sbi->record_size)\nbuffer allocated by mi_init() (record.c:105):\n\n\tmemmove(Add2Ptr(attr, asize), attr, used - roff);\n\tmemcpy(attr, attr2, asize);\n\trec->used = cpu_to_le32(used + asize);\n\nWith record_size 0x400, roff 0x38, used 0x160 and asize 0x800 the memcpy\nwrites 2048 bytes at rec + 0x38, 0x438 bytes past the allocation, and\nrec->used is left at 0x960.  dlen is 0x18 here, so the existing\ndlen check passes: dlen bounds nothing about the size of the copy.\n\nThe equivalent non-replay path already refuses this.  mi_insert_attr()\nperforms the same insert and starts with (record.c:488):\n\n\tif (used + asize > sbi->record_size)\n\t\treturn NULL;\n\nApply the same bound, spelled as a subtraction to match the neighbouring\nclause.  used <= record_size holds here because check_file_record()\nvalidates it (fslog.c:2826) and is called on this record at fslog.c:3172;\nroff <= used - 4 follows from check_if_attr() together with the ATTR_END\ncheck at fslog.c:2844, so bounding used + asize bounds both copies.\n\nThe sibling WriteEndOfFileRecordSegment case does the equivalent check\nagainst record_size at fslog.c:3277.\n\nReproduced by mounting a crafted image on v7.2-rc5 under KASAN:\n\n  BUG: KASAN: slab-out-of-bounds in do_action.isra.0+0x41f6/0x83a0\n  Write of size 2048 at addr ffff888005c74838 by task mount/69\n\n  CPU: 0 UID: 0 PID: 69 Comm: mount Not tainted 7.2.0-rc5-00300-g8ba098e6b6ff #2\n  Call Trace:\n   kasan_report+0xce/0x100\n   kasan_check_range+0x105/0x1b0\n   __asan_memcpy+0x3c/0x60\n   do_action.isra.0+0x41f6/0x83a0\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 69:\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+0x1db4/0x83a0\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 ffff888005c74800\n   which belongs to the cache kmalloc-1k of size 1024\n  The buggy address is located 56 bytes inside of\n   allocated 1024-byte region [ffff888005c74800, ffff888005c74c00)","Type":"Description","Title":"fs/ntfs3: bound CreateAttribute asize against record_size in do_"}]}}}