{"id":"AZL-100406","summary":"CVE-2026-89493 affecting package kernel 6.6.150.1-1","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nocfs2: validate rl_used against rl_count in refcount block validator\n\nocfs2_find_refcount_rec_in_rl() walks the on-disk refcount record array\nwith:\n\n\tfor (; i \u003c le16_to_cpu(rb-\u003erf_records.rl_used); i++) {\n\t\trec = &rb-\u003erf_records.rl_recs[i];\n\t\t...\n\nrl_recs[] lives in a single metadata block (4096 bytes on the common\nconfiguration), so its real capacity is fixed by\nocfs2_refcount_recs_per_rb(sb) (247 records for a 4K block with the\n16-byte ocfs2_refcount_rec).  rl_used and rl_count are both read directly\noff disk by ocfs2_validate_refcount_block() and are never checked against\nthat capacity, nor against each other, before any refcount/reflink/CoW\noperation walks the array.\n\nA crafted (or corrupted) refcount block with rl_used == 0xffff makes the\nloop above walk far past the end of the block, dereferencing rl_recs[i]\nfor i up to 65534.  The resulting index is then handed to the sibling\nocfs2_insert_refcount_rec(), whose insert-shift does:\n\n\tif (index \u003c le16_to_cpu(rf_list-\u003erl_used))\n\t\tmemmove(&rf_list-\u003erl_recs[index + 1],\n\t\t\t&rf_list-\u003erl_recs[index],\n\t\t\t(le16_to_cpu(rf_list-\u003erl_used) - index) *\n\t\t\t sizeof(struct ocfs2_refcount_rec));\n\ni.e.  a memmove() of up to (0xffff - index) * 16 bytes (~1 MiB) from an\noffset already past the block.  This is reachable from an ordinary reflink\n(FICLONE) against a crafted/corrupted ocfs2 image: attaching an extent\nwhose cpos sorts past every real record in the leaf forces the lookup to\nrun off the end instead of returning early on a match.  The attacker model\nis local: CAP_SYS_ADMIN mounting a crafted or corrupted ocfs2 image, or a\nraw write to the block device backing an already-mounted ocfs2 filesystem.\n\nocfs2_validate_refcount_block() already validates the block's ECC,\nsignature, rf_blkno and rf_fs_generation, but never rl_count/rl_used\nagainst the block's actual on-disk capacity.  This is the same class of\ngap that ocfs2_validate_extent_block() (fs/ocfs2/alloc.c) already closes\nfor the sibling extent-list header, which checks both the record capacity\nand the \"used\" bound before any code walks h_list.l_recs[]:\n\n\tif (le16_to_cpu(eb-\u003eh_list.l_count) != ocfs2_extent_recs_per_eb(sb)) {\n\t\trc = ocfs2_error(...);\n\t\tgoto bail;\n\t}\n\n\tif (le16_to_cpu(eb-\u003eh_list.l_next_free_rec) \u003e\n\t    le16_to_cpu(eb-\u003eh_list.l_count)) {\n\t\trc = ocfs2_error(...);\n\t\tgoto bail;\n\t}\n\nAdd the equivalent pair of checks to ocfs2_validate_refcount_block():\nreject a refcount block whose rl_count does not match the fixed per-block\ncapacity returned by ocfs2_refcount_recs_per_rb(), and reject rl_used \u003e\nrl_count.  Both checks are skipped when OCFS2_REFCOUNT_TREE_FL is set,\nbecause in that case the same union bytes hold an ocfs2_extent_list\n(rf_list), not the refcount record list (rf_records) -- that layout is\nalready validated separately by ocfs2_validate_extent_block() when the\nreferenced extent block is read.  This mirrors the existing\n\"!(rb-\u003erf_flags & OCFS2_REFCOUNT_TREE_FL)\" guard used elsewhere in this\nfile (e.g.  ocfs2_get_refcount_rec()) to decide whether rf_records or\nrf_list is the live member of the union.\n\nWith this in place, a forged rl_used/rl_count is caught at block\nvalidation time (ocfs2_error()), consistent with every other corruption\ncheck in this function, instead of driving an out-of-bounds read in\nocfs2_find_refcount_rec_in_rl() and a subsequent out-of-bounds memmove()\nin ocfs2_insert_refcount_rec().\n\nVerified against a crafted image on a v6.19 KASAN (KASAN_GENERIC) build:\nreplaying the same reflink (FICLONE) reliably hit a KASAN report in\n__ocfs2_increase_refcount()/ocfs2_insert_refcount_rec() before this patch,\nand triggers no report once ocfs2_validate_refcount_block() rejects the\nforged rl_used/rl_count.","modified":"2026-09-13T06:06:36Z","published":"2026-09-11T20:19:31Z","upstream":["CVE-2026-89493"],"references":[{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-89493"}],"affected":[{"package":{"name":"kernel","ecosystem":"Azure Linux:3","purl":"pkg:rpm/azure-linux/kernel"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"6.6.150.1-1"}]}],"database_specific":{"source":"https://github.com/microsoft/AzureLinuxVulnerabilityData/blob/main/osv/AZL-100406.json"}}],"schema_version":"1.9.0"}