{"id":"CVE-2026-138889","aliases":["CVE-2026-138889"],"related":[],"kind":"vulnerability","state":"published","title":"ocfs2: restrict OCFS2_INVALID_SLOT suballoc slot to system inodes","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nocfs2: restrict OCFS2_INVALID_SLOT suballoc slot to system inodes\n\nPatch series \"ocfs2: validate suballoc slot and bit of metadata blocks\", v3.\n\nThe ocfs2 metadata validators trust the on-disk suballoc slot and bit\nwithout checking them against the slot range of the mounted filesystem and\nthe capacity of the block group bitmap.  A corrupted image can carry\nOCFS2_INVALID_SLOT or another out-of-range slot, or a suballoc bit beyond\nthe bitmap, and once the corresponding inode, extent block, xattr block,\ndir index root or refcount block gets freed, the bad value goes straight\ninto ocfs2_get_system_file_inode() or _ocfs2_free_suballoc_bits() and hits\na BUG_ON() or runs off the end of local_system_inodes[].\n\nThis series rejects such values at read time, in the existing validators,\nso corrupted objects fail with -EROFS (and a read-only remount) instead of\ncrashing:\n\n  patch 1 restricts OCFS2_INVALID_SLOT dinodes to system inodes,\n        completing fe7a283b3916 (\"ocfs2: add suballoc slot check in\n        ocfs2_validate_inode_block()\"), and turns the \"system file\n        state is ambiguous\" BUG_ON() in ocfs2_read_locked_inode() into\n        an ocfs2_error();\n  patch 2 rejects oversized dinode suballoc bits;\n  patch 3 validates the suballoc slot and bit of xattr and dir index\n        blocks;\n  patch 4 validates the suballoc slot and bit of extent and refcount\n        blocks.\n\nThe checks only enforce what the kernel and mkfs.ocfs2 already write: a\nvalid slot from meta_ac->ac_alloc_slot and a bit within the block group\nbitmap, with system inodes carrying OCFS2_INVALID_SLOT plus\nOCFS2_SYSTEM_FL and extent blocks using slot 0.  Nothing changes for\nhealthy filesystems.\n\nEach new check was exercised under QEMU by corrupting the field in\nquestion with an out-of-range value; with the series applied the access\nfails with -EROFS and the filesystem remounts read-only instead of hitting\nthe BUG_ON().\n\n\nThis patch (of 4):\n\nocfs2_validate_inode_block() currently permits i_suballoc_slot to be\nOCFS2_INVALID_SLOT for any dinode.  Only system inodes created by\nmkfs.ocfs2 are allocated from the global allocator and thus legitimately\ncarry this value; regular inodes are always allocated from a per-slot\nsuballocator and hence must have a valid slot.\n\nIf a corrupted regular inode with OCFS2_INVALID_SLOT is accepted,\nocfs2_remove_inode() will pass the slot to ocfs2_get_system_file_inode()\nand get_local_system_inode() will hit BUG_ON(slot == OCFS2_INVALID_SLOT)\nwhen the inode is deleted.  This can be triggered by an unprivileged user\nunlinking such a corrupted file.\n\nReject OCFS2_INVALID_SLOT for non-system dinodes during validation, while\nstill accepting it for system inodes.  Note that a crafted dinode carrying\nOCFS2_SYSTEM_FL passes the check above, yet a plain lookup of it still\nused to BUG() in ocfs2_read_locked_inode() (\"system file state is\nambiguous\").  Since i_flags comes from disk, handle that mismatch with\nocfs2_error() instead of BUG_ON() as well.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nocfs2: restrict OCFS2_INVALID_SLOT suballoc slot to system inodes\n\nPatch series \"ocfs2: validate suballoc slot and bit of metadata blocks\", v3.\n\nThe ocfs2 metadata validators trust the on-disk suballoc slot and bit\nwithout checking them against the slot range of the mounted filesystem and\nthe capacity of the block group bitmap.  A corrupted image can carry\nOCFS2_INVALID_SLOT or another out-of-range slot, or a suballoc bit beyond\nthe bitmap, and once the corresponding inode, extent block, xattr block,\ndir index root or refcount block gets freed, the bad value goes straight\ninto ocfs2_get_system_file_inode() or _ocfs2_free_suballoc_bits() and hits\na BUG_ON() or runs off the end of local_system_inodes[].\n\nThis series rejects such values at read time, in the existing validators,\nso corrupted objects fail with -EROFS (and a read-only remount) instead of\ncrashing:\n\n  patch 1 restricts OCFS2_INVALID_SLOT dinodes to system inodes,\n        completing fe7a283b3916 (\"ocfs2: add suballoc slot check in\n        ocfs2_validate_inode_block()\"), and turns the \"system file\n        state is ambiguous\" BUG_ON() in ocfs2_read_locked_inode() into\n        an ocfs2_error();\n  patch 2 rejects oversized dinode suballoc bits;\n  patch 3 validates the suballoc slot and bit of xattr and dir index\n        blocks;\n  patch 4 validates the suballoc slot and bit of extent and refcount\n        blocks.\n\nThe checks only enforce what the kernel and mkfs.ocfs2 already write: a\nvalid slot from meta_ac->ac_alloc_slot and a bit within the block group\nbitmap, with system inodes carrying OCFS2_INVALID_SLOT plus\nOCFS2_SYSTEM_FL and extent blocks using slot 0.  Nothing changes for\nhealthy filesystems.\n\nEach new check was exercised under QEMU by corrupting the field in\nquestion with an out-of-range value; with the series applied the access\nfails with -EROFS and the filesystem remounts read-only instead of hitting\nthe BUG_ON().\n\n\nThis patch (of 4):\n\nocfs2_validate_inode_block() currently permits i_suballoc_slot to be\nOCFS2_INVALID_SLOT for any dinode.  Only system inodes created by\nmkfs.ocfs2 are allocated from the global allocator and thus legitimately\ncarry this value; regular inodes are always allocated from a per-slot\nsuballocator and hence must have a valid slot.\n\nIf a corrupted regular inode with OCFS2_INVALID_SLOT is accepted,\nocfs2_remove_inode() will pass the slot to ocfs2_get_system_file_inode()\nand get_local_system_inode() will hit BUG_ON(slot == OCFS2_INVALID_SLOT)\nwhen the inode is deleted.  This can be triggered by an unprivileged user\nunlinking such a corrupted file.\n\nReject OCFS2_INVALID_SLOT for non-system dinodes during validation, while\nstill accepting it for system inodes.  Note that a crafted dinode carrying\nOCFS2_SYSTEM_FL passes the check above, yet a plain lookup of it still\nused to BUG() in ocfs2_read_locked_inode() (\"system file state is\nambiguous\").  Since i_flags comes from disk, handle that mismatch with\nocfs2_error() instead of BUG_ON() as well.","source":"cvelist"}],"published":"2026-11-30T13:25:55.940Z","modified":"2026-12-01T06:17:30.270Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"688d054a680c20ba3bf85de67ca780befc7ffc7b","fixed":"cef7a01a416aede5f77a84ffc6a4c606368e3d5f","status":"affected"},{"type":"git","introduced":"b8fa4d063e3b0c37ec406a1fb6b5033337fb879d","fixed":"9cc83c00b9b4f0e0a5842864b1a320fa63ecfc5c","status":"affected"},{"type":"git","introduced":"c416b59dbc547f5555e561dee1484a55dcbb79dd","fixed":"af08d7bef319df99c71107e0034244168822aa42","status":"affected"},{"type":"git","introduced":"fe7a283b39160153b6d1bd7f61b0a9d5d44987a8","fixed":"de648cd4c54e659d5d212bdbe158f135569161cb","status":"affected"},{"type":"git","introduced":"fe7a283b39160153b6d1bd7f61b0a9d5d44987a8","fixed":"c55809688e4abbc4474f28849deea6e5cee2684c","status":"affected"},{"type":"git","introduced":"fe7a283b39160153b6d1bd7f61b0a9d5d44987a8","fixed":"25bf9e549360b656a6763232e0e9e58a00c3aff7","status":"affected"},{"type":"semver","introduced":"6.1.191","fixed":"6.1.193","status":"affected"},{"type":"semver","introduced":"6.6.160","fixed":"6.6.163","status":"affected"},{"type":"semver","introduced":"6.12.114","fixed":"6.12.118","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.18","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.18","status":"unaffected"},{"type":"semver","introduced":"6.1.193","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.163","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.118","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.63","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.4","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/cef7a01a416aede5f77a84ffc6a4c606368e3d5f","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9cc83c00b9b4f0e0a5842864b1a320fa63ecfc5c","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/af08d7bef319df99c71107e0034244168822aa42","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/de648cd4c54e659d5d212bdbe158f135569161cb","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c55809688e4abbc4474f28849deea6e5cee2684c","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/25bf9e549360b656a6763232e0e9e58a00c3aff7","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-138889","url":"https://www.cve.org/CVERecord?id=CVE-2026-138889","licence":"CVE Terms of Use","modified":"2026-12-01T05:40:31.449Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-138889","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-138889","licence":"Public domain","modified":"2026-12-01T06:17:30.270Z"}],"updatedAt":"2026-12-01T06:32:16.891Z","epss":{"score":0.00733,"percentile":0.55587,"date":"2026-12-01T12:00:22.000Z"}}