{"id":"CVE-2026-99395","state":"PUBLISHED","title":"xfs: bound inode fork length against the fork size during log recovery","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nxfs: bound inode fork length against the fork size during log recovery\n\nxlog_recover_inode_commit_pass2() copies an inode log item's data/attr\nfork region into the inode buffer using the on-log region length without\nbounding it against the fork capacity, e.g.:\n\n\tlen = item->ri_buf[2].iov_len;\n\tmemcpy(XFS_DFORK_DPTR(dip), src, len);\n\nThe only guard is an ASSERT, which is a no-op on production kernels\n(CONFIG_XFS_DEBUG off), and xfs_dinode_verify() runs only after the copy.\nA crafted image with a dirty log can therefore drive a heap out-of-bounds\nwrite at mount time. The XFS_ILOG_DBROOT sibling already passes\nXFS_DFORK_DSIZE as a bound; the DDATA/DEXT and ADATA/AEXT memcpy paths\ndid not.\n\nBound each logged fork region against the destination fork size before\ncopying it, and reject the log item with -EFSCORRUPTED when it does not\nfit. Because the recovered inode is only verified after the fork data has\nbeen copied in, the checks are done up front, before any memcpy into the\non-disk inode.","publishedAt":"2026-11-19T14:23:33.347Z","updatedAt":"2026-11-22T11:08:03.955Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"658fa68b6f34f73c7e4023489accd34c1db91cb1","status":"affected","lessThan":"af559d87fdd921b90c86125f78d8b97d754432dd","versionType":"git"},{"version":"658fa68b6f34f73c7e4023489accd34c1db91cb1","status":"affected","lessThan":"f2cc5001ffcc1d8e5e16607ce4b6920ea30c2cfe","versionType":"git"},{"version":"658fa68b6f34f73c7e4023489accd34c1db91cb1","status":"affected","lessThan":"e2768e65a5f2f942c831e3df3b06ad7332d423e6","versionType":"git"},{"version":"658fa68b6f34f73c7e4023489accd34c1db91cb1","status":"affected","lessThan":"9232301894a06e664d8de2da97175cf98419bd16","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/xfs/xfs_inode_item_recover.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.8","versionType":"semver"},{"version":"6.12.117","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.61","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.2","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/xfs/xfs_inode_item_recover.c"]}],"references":["https://git.kernel.org/stable/c/af559d87fdd921b90c86125f78d8b97d754432dd","https://git.kernel.org/stable/c/f2cc5001ffcc1d8e5e16607ce4b6920ea30c2cfe","https://git.kernel.org/stable/c/e2768e65a5f2f942c831e3df3b06ad7332d423e6","https://git.kernel.org/stable/c/9232301894a06e664d8de2da97175cf98419bd16"],"weaknesses":[],"ingestedAt":"2026-11-22T11:18:06.032Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/99xxx/CVE-2026-99395.json","commit":"247cc9beefd85903834df0592e88a44f4d599223","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-99395","state":"PUBLISHED","datePublished":"2026-11-19T14:23:33.347Z","dateUpdated":"2026-11-22T11:08:03.955Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-09-25T10:25:14.412Z"},"containers":{"cna":{"title":"xfs: bound inode fork length against the fork size during log recovery","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nxfs: bound inode fork length against the fork size during log recovery\n\nxlog_recover_inode_commit_pass2() copies an inode log item's data/attr\nfork region into the inode buffer using the on-log region length without\nbounding it against the fork capacity, e.g.:\n\n\tlen = item->ri_buf[2].iov_len;\n\tmemcpy(XFS_DFORK_DPTR(dip), src, len);\n\nThe only guard is an ASSERT, which is a no-op on production kernels\n(CONFIG_XFS_DEBUG off), and xfs_dinode_verify() runs only after the copy.\nA crafted image with a dirty log can therefore drive a heap out-of-bounds\nwrite at mount time. The XFS_ILOG_DBROOT sibling already passes\nXFS_DFORK_DSIZE as a bound; the DDATA/DEXT and ADATA/AEXT memcpy paths\ndid not.\n\nBound each logged fork region against the destination fork size before\ncopying it, and reject the log item with -EFSCORRUPTED when it does not\nfit. Because the recovered inode is only verified after the fork data has\nbeen copied in, the checks are done up front, before any memcpy into the\non-disk inode."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"658fa68b6f34f73c7e4023489accd34c1db91cb1","status":"affected","lessThan":"af559d87fdd921b90c86125f78d8b97d754432dd","versionType":"git"},{"version":"658fa68b6f34f73c7e4023489accd34c1db91cb1","status":"affected","lessThan":"f2cc5001ffcc1d8e5e16607ce4b6920ea30c2cfe","versionType":"git"},{"version":"658fa68b6f34f73c7e4023489accd34c1db91cb1","status":"affected","lessThan":"e2768e65a5f2f942c831e3df3b06ad7332d423e6","versionType":"git"},{"version":"658fa68b6f34f73c7e4023489accd34c1db91cb1","status":"affected","lessThan":"9232301894a06e664d8de2da97175cf98419bd16","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/xfs/xfs_inode_item_recover.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.8","versionType":"semver"},{"version":"6.12.117","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.61","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.2","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/xfs/xfs_inode_item_recover.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/af559d87fdd921b90c86125f78d8b97d754432dd"},{"url":"https://git.kernel.org/stable/c/f2cc5001ffcc1d8e5e16607ce4b6920ea30c2cfe"},{"url":"https://git.kernel.org/stable/c/e2768e65a5f2f942c831e3df3b06ad7332d423e6"},{"url":"https://git.kernel.org/stable/c/9232301894a06e664d8de2da97175cf98419bd16"}],"metrics":[{"cvssV3_1":{"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"},"scenarios":[{"lang":"en","value":"AV:L - The overflowing bytes are the on-disk log fork region: xlog_recover_add_to_trans records oh_len as ri_buf[].iov_len, and xlog_recover_inode_commit_pass2 copies that length into the inode buffer from xlog_recover pass 2, reached by xfs_log_mount in xfs_fs_fill_super. The log record is image data, not a protocol message.\nAC:L - The attacker sets a dirty log (tail_blk != head_blk), ilf_fields to XFS_ILOG_DDATA, XFS_ILOG_DEXT, XFS_ILOG_ADATA, or XFS_ILOG_AEXT, and an oh_len larger than XFS_DFORK_DSIZE or XFS_DFORK_ASIZE. xlog_recover then hits the memcpy on a normal mount; no race, media fault, or norecovery mount option is involved.\nPR:N - Supplying the image requires no credential. The mount and fsopen paths reach recovery only after mount_capable(), which demands init-namespace CAP_SYS_ADMIN because xfs_fs_type does not set FS_USERNS_MOUNT; that capability is used by the user who performs the mount.\nUI:R - xlog_recover_inode_commit_pass2 is called only from xfs_log_mount during xfs_mountfs in xfs_fs_fill_super. File operations on an already-mounted filesystem cannot inject the oversized log oh_len, so a user has to mount the supplied image.\nS:U - The write corrupts the host kernel's inode buffer from xfs_buf_alloc_backing_mem and memory adjacent to it. Impact stays in that kernel; XFS is not mountable from a user namespace, and the bug is not a guest-to-host or IOMMU crossing.\nC:H - The memcpy copies attacker-chosen fork bytes for an attacker-chosen iov_len with no production check against XFS_DFORK_DSIZE. A v5 image with a 1024-byte block and ilf_len of one block uses a 1024-byte kmalloc from xfs_buf_alloc_kmem, so a multi-kilobyte oh_len is a controlled heap overflow that can be leveraged to disclose adjacent memory.\nI:H - The DDATA/DEXT memcpy uses ri_buf iov_len with no comparison to XFS_DFORK_DSIZE; the nearby ASSERT only requires len == xlog_calc_iovec_len(ilf_dsize), and ilf_dsize is a uint16 the image sets. The ADATA/AEXT path's len <= XFS_DFORK_ASIZE check was an ASSERT, absent unless CONFIG_XFS_DEBUG is on.\nA:H - The memcpy runs before xfs_dinode_verify. Writing past the inode buffer corrupts neighboring kernel allocations and oopses or panics the host; returning -EFSCORRUPTED from recovery does not undo the overflow."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-22T11:08:03.955Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"6.12.117"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"6.18.61"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"7.3.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}