{"id":"CVE-2026-139507","summary":"ocfs2: allow xattr bucket entries to span multiple blocks","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nocfs2: allow xattr bucket entries to span multiple blocks\n\nPatch series \"ocfs2: xattr bucket validation fixes\", v2.\n\nThis series fixes two problems around xattr bucket validation.\n\nPatch 1 fixes a false-corruption failure on blocksize-512 volumes: the\nbucket validator limited the entry array to the first bucket block while\nthe write path stores entries across the whole 4096-byte bucket region, so\na legitimately written, fsck-clean bucket could be rejected and force the\nfilesystem read-only.  It also adds an alignment check on the bucket block\nnumber, since the entry array is accessed as one contiguous region and a\ncorrupted xattr tree could otherwise point a bucket at blocks straddling a\npage boundary.\n\nPatch 2 converts two mlog_bug_on_msg() checks in the bucket defrag path to\nocfs2_error() returns, so that a corrupt bucket holding overlapping\nentries or an inflated xh_free_start marks the filesystem read-only and\nfails the setxattr instead of panicking the kernel.\n\nBoth patches have been tested in QEMU: the blocksize-512 reproducer (40\nxattrs with 100-byte values, previously failing with \"entry count 32\nexceeds maximum 31\") now passes with a clean fsck.ocfs2 result, and the\nocfs2 testsuite xattr tests pass 48/48 across blocksize combinations.\n\n\nThis patch (of 2):\n\nocfs2_validate_xattr_bucket() limits the entry array to the first bucket\nblock, but the write path stores entries across the whole\nOCFS2_XATTR_BUCKET_SIZE region.  With 512-byte blocks a bucket spans eight\nblocks, and a bucket filled with small xattrs places its last entries past\noffset 512.  Reading such a bucket back errors out:\n\n  OCFS2: ERROR (device loop0): ocfs2_validate_xattr_bucket: Invalid xattr bucket 86072: entry count 32 exceeds maximum 31\n  On-disk corruption discovered. Please run fsck.ocfs2 once the filesystem is unmounted.\n  OCFS2: File system is now read-only.\n\nThis is reproducible by setting ~33 xattrs with 100-byte values on a file\non a blocksize-512 volume; fsck.ocfs2 reports the resulting image clean.\n\nCheck the entry count against the full bucket region instead.  The\nper-block bounds checks for names and values stay as they are, since\nocfs2_bucket_align_free_start() keeps each name+value pair within a single\nblock.\n\nThe entry array is one contiguous region, so a bucket from a corrupted\nxattr tree whose first block is not aligned to OCFS2_XATTR_BUCKET_SIZE\ncould straddle a page and make the validation loop read out of bounds. \nBuckets allocated within clusters are always aligned, so reject any other\nblock number while validating.","modified":"2026-11-30T15:02:29.093644259Z","published":"2026-11-30T13:35:23.485Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139507.json"},"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/13745a6cc1f82f88365fb06a5590eba35e79cfab"},{"type":"WEB","url":"https://git.kernel.org/stable/c/4b0adafbb676900ffa674306c4325ee7f4837f2f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/78cce2082d22d3c56bd3a6146ef0dcf7cd661a33"},{"type":"WEB","url":"https://git.kernel.org/stable/c/a0ab8943a115e5806d64fc81af0b939dbf2575e6"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139507.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139507"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"dc5778dbd0b6c411107a0e37e913a94b3c2f2728"},{"fixed":"13745a6cc1f82f88365fb06a5590eba35e79cfab"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"ee4ef26927e967ea699b3f0d7ecf97ce044fbc79"},{"fixed":"a0ab8943a115e5806d64fc81af0b939dbf2575e6"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"2cf82b46d5e43be0dfbaac7fa1073cec2fc1f5e6"},{"fixed":"4b0adafbb676900ffa674306c4325ee7f4837f2f"},{"fixed":"78cce2082d22d3c56bd3a6146ef0dcf7cd661a33"}]},{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"9f4129b6905b7d638bbc9eb8013c3989cbe30b7e"}]}],"versions":["v6.6.162","v6.6.161","v6.6.160","v6.12.118","v6.12.117","v6.12.116","v6.12.115","v6.12.114","v7.2.15","v7.2.14","v7.2.13","v7.2.12","v7.2.11","v7.2.10","v7.2.9","v7.2.8","v7.2.7","v7.2.6"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-139507.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.6.160"},{"fixed":"6.6.163"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.12.114"},{"fixed":"6.12.119"}]},{"type":"ECOSYSTEM","events":[{"introduced":"7.2.6"},{"fixed":"7.3"}]},{"type":"ECOSYSTEM","events":[{"introduced":"7.3.0"},{"fixed":"7.3.6"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-139507.json"}}],"schema_version":"1.9.2"}