{"id":52403,"date":"2026-05-08T08:44:25","date_gmt":"2026-05-08T08:44:25","guid":{"rendered":"https:\/\/zero.redgem.net\/?p=52403"},"modified":"2026-05-08T08:44:25","modified_gmt":"2026-05-08T08:44:25","slug":"xfs-fix-freemap-adjustments-when-adding-xattrs-to-leaf-blocks","status":"publish","type":"post","link":"https:\/\/zero.redgem.net\/?p=52403","title":{"rendered":"xfs: fix freemap adjustments when adding xattrs to leaf blocks_CVE-2026-43158"},"content":{"rendered":"<p>{&#8220;lastseen&#8221;:&#8221;&#8221;,&#8221;description&#8221;:&#8221;In the Linux kernel, the following vulnerability has been resolved:\\n\\nxfs: fix freemap adjustments when adding xattrs to leaf blocks\\n\\nxfs\/592 and xfs\/794 both trip this assertion in the leaf block freemap\\nadjustment code after ~20 minutes of running on my test VMs:\\n\\n ASSERT(ichdr-\\u003efirstused \\u003e= ichdr-\\u003ecount * sizeof(xfs_attr_leaf_entry_t)\\n\\t\\t\\t\\t\\t+ xfs_attr3_leaf_hdr_size(leaf));\\n\\nUpon enabling quite a lot more debugging code, I narrowed this down to\\nfsstress trying to set a local extended attribute with namelen=3 and\\nvaluelen=71.  This results in an entry size of 80 bytes.\\n\\nAt the start of xfs_attr3_leaf_add_work, the freemap looks like this:\\n\\ni 0 base 448 size 0 rhs 448 count 46\\ni 1 base 388 size 132 rhs 448 count 46\\ni 2 base 2120 size 4 rhs 448 count 46\\nfirstused = 520\\n\\nwhere \\&#8221;rhs\\&#8221; is the first byte past the end of the leaf entry array.\\nThis is inconsistent &#8212; the entries array ends at byte 448, but\\nfreemap[1] says there&#8217;s free space starting at byte 388!\\n\\nBy the end of the function, the freemap is in worse shape:\\n\\ni 0 base 456 size 0 rhs 456 count 47\\ni 1 base 388 size 52 rhs 456 count 47\\ni 2 base 2120 size 4 rhs 456 count 47\\nfirstused = 440\\n\\nImportant note: 388 is not aligned with the entries array element size\\nof 8 bytes.\\n\\nBased on the incorrect freemap, the name area starts at byte 440, which\\nis below the end of the entries array!  That&#8217;s why the assertion\\ntriggers and the filesystem shuts down.\\n\\nHow did we end up here?  First, recall from the previous patch that the\\nfreemap array in an xattr leaf block is not intended to be a\\ncomprehensive map of all free space in the leaf block.  In other words,\\nit&#8217;s perfectly legal to have a leaf block with:\\n\\n * 376 bytes in use by the entries array\\n * freemap[0] has [base = 376, size = 8]\\n * freemap[1] has [base = 388, size = 1500]\\n * the space between 376 and 388 is free, but the freemap stopped\\n   tracking that some time ago\\n\\nIf we add one xattr, the entries array grows to 384 bytes, and\\nfreemap[0] becomes [base = 384, size = 0].  So far, so good.  But if we\\nadd a second xattr, the entries array grows to 392 bytes, and freemap[0]\\ngets pushed up to [base = 392, size = 0].  This is bad, because\\nfreemap[1] hasn&#8217;t been updated, and now the entries array and the free\\nspace claim the same space.\\n\\nThe fix here is to adjust all freemap entries so that none of them\\ncollide with the entries array.  Note that this fix relies on commit\\n2a2b5932db6758 (\\&#8221;xfs: fix attr leaf header freemap.size underflow\\&#8221;) and\\nthe previous patch that resets zero length freemap entries to have\\nbase = 0.&#8221;,&#8221;published&#8221;:&#8221;2026-05-06T11:27:37.848Z&#8221;,&#8221;modified&#8221;:&#8221;2026-05-08T12:40:53.855Z&#8221;,&#8221;type&#8221;:&#8221;cve&#8221;,&#8221;title&#8221;:&#8221;xfs: fix freemap adjustments when adding xattrs to leaf blocks&#8221;,&#8221;source&#8221;:&#8221;Linux&#8221;,&#8221;references&#8221;:&#8221;https:\/\/git.kernel.org\/stable\/c\/d08976725355b9d54d8332fce223fa281cc304a5\\nhttps:\/\/git.kernel.org\/stable\/c\/6a8737afbccc340e718e0b22577312826390be8b\\nhttps:\/\/git.kernel.org\/stable\/c\/a396b3d73d51355e50acdb403ba9c4cae4c1174e\\nhttps:\/\/git.kernel.org\/stable\/c\/38613c01f69e1e77e6b8acab1e8ac665d01c2f15\\nhttps:\/\/git.kernel.org\/stable\/c\/ef42a8766ff3fdf51cf72fb36d0859c09d134478\\nhttps:\/\/git.kernel.org\/stable\/c\/43f3b18679615a93bd848afde3602ba160637a46\\nhttps:\/\/git.kernel.org\/stable\/c\/24ce71852f2cee6581e2cbebc15489ed52bf63b7\\nhttps:\/\/git.kernel.org\/stable\/c\/3eefc0c2b78444b64feeb3783c017d6adc3cd3ce&#8221;,&#8221;id&#8221;:&#8221;CVE-2026-43158&#8243;,&#8221;bulletinFamily&#8221;:&#8221;&#8221;,&#8221;cwe&#8221;:null,&#8221;cvelist&#8221;:null,&#8221;sourceData&#8221;:&#8221;Linux Linux 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2\\nLinux Linux 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2\\nLinux Linux 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2\\nLinux Linux 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2\\nLinux Linux 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2\\nLinux Linux 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2\\nLinux Linux 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2\\nLinux Linux 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2\\nLinux Linux 2.6.12&#8243;,&#8221;sourceHref&#8221;:&#8221;&#8221;,&#8221;cvss&#8221;:{&#8220;score&#8221;:8.8,&#8221;severity&#8221;:&#8221;HIGH&#8221;,&#8221;vector&#8221;:&#8221;CVSS:3.1\/AV:N\/AC:L\/PR:L\/UI:N\/S:U\/C:H\/I:H\/A:H&#8221;,&#8221;version&#8221;:&#8221;3.1&#8243;},&#8221;cvss2&#8243;:{},&#8221;cvss3&#8243;:{&#8220;version&#8221;:&#8221;&#8221;,&#8221;vectorString&#8221;:&#8221;&#8221;,&#8221;baseScore&#8221;:0,&#8221;baseSeverity&#8221;:&#8221;&#8221;,&#8221;attackVector&#8221;:&#8221;&#8221;,&#8221;attackComplexity&#8221;:&#8221;&#8221;,&#8221;privilegesRequired&#8221;:&#8221;&#8221;,&#8221;userInteraction&#8221;:&#8221;&#8221;,&#8221;scope&#8221;:&#8221;&#8221;,&#8221;confidentialityImpact&#8221;:&#8221;&#8221;,&#8221;integrityImpact&#8221;:&#8221;&#8221;,&#8221;availabilityImpact&#8221;:&#8221;&#8221;,&#8221;cvssV3&#8243;:{&#8220;version&#8221;:&#8221;&#8221;,&#8221;vectorString&#8221;:&#8221;&#8221;,&#8221;baseScore&#8221;:0,&#8221;baseSeverity&#8221;:&#8221;&#8221;,&#8221;attackVector&#8221;:&#8221;&#8221;,&#8221;attackComplexity&#8221;:&#8221;&#8221;,&#8221;privilegesRequired&#8221;:&#8221;&#8221;,&#8221;userInteraction&#8221;:&#8221;&#8221;,&#8221;scope&#8221;:&#8221;&#8221;,&#8221;confidentialityImpact&#8221;:&#8221;&#8221;,&#8221;integrityImpact&#8221;:&#8221;&#8221;,&#8221;availabilityImpact&#8221;:&#8221;&#8221;}},&#8221;href&#8221;:&#8221;&#8221;,&#8221;category_name&#8221;:&#8221;CVE&#8221;,&#8221;post_link&#8221;:&#8221;&#8221;,&#8221;product&#8221;:&#8221;Linux&#8221;,&#8221;version&#8221;:&#8221;1da177e4c3f41524e886b7f1b8a0c1fc7321cac2&#8243;,&#8221;vendor&#8221;:&#8221;Linux&#8221;,&#8221;ai_description&#8221;:&#8221;AI processing failed &#8211; no valid JSON found&#8221;,&#8221;ai_severity&#8221;:&#8221;&#8221;,&#8221;ai_vendor&#8221;:&#8221;&#8221;,&#8221;ai_product&#8221;:&#8221;&#8221;,&#8221;ai_version&#8221;:&#8221;&#8221;,&#8221;ai_score&#8221;:0}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>{&#8220;lastseen&#8221;:&#8221;&#8221;,&#8221;description&#8221;:&#8221;In the Linux kernel, the following vulnerability has been resolved:\\n\\nxfs: fix freemap adjustments when adding xattrs to leaf blocks\\n\\nxfs\/592 and xfs\/794 both trip this assertion&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[6,8,41,12,15,13,7,11,5],"class_list":["post-52403","post","type-post","status-publish","format-standard","hentry","category-category_cve","tag-cve","tag-cvss","tag-cvss-88","tag-exploit","tag-high","tag-news","tag-security","tag-tapic","tag-vulnerability"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>xfs: fix freemap adjustments when adding xattrs to leaf blocks_CVE-2026-43158 - zero redgem<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/zero.redgem.net\/?p=52403\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"xfs: fix freemap adjustments when adding xattrs to leaf blocks_CVE-2026-43158 - zero redgem\" \/>\n<meta property=\"og:description\" content=\"{&#8220;lastseen&#8221;:&#8221;&#8221;,&#8221;description&#8221;:&#8221;In the Linux kernel, the following vulnerability has been resolved:nnxfs: fix freemap adjustments when adding xattrs to leaf blocksnnxfs\/592 and xfs\/794 both trip this assertion...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/zero.redgem.net\/?p=52403\" \/>\n<meta property=\"og:site_name\" content=\"zero redgem\" \/>\n<meta property=\"article:published_time\" content=\"2026-05-08T08:44:25+00:00\" \/>\n<meta name=\"author\" content=\"invoker\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"invoker\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=52403#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=52403\"},\"author\":{\"name\":\"invoker\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/person\\\/fbfeae8dfad117ac08a7621bee1a1dca\"},\"headline\":\"xfs: fix freemap adjustments when adding xattrs to leaf blocks_CVE-2026-43158\",\"datePublished\":\"2026-05-08T08:44:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=52403\"},\"wordCount\":830,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#organization\"},\"keywords\":[\"CVE\",\"CVSS\",\"CVSS-8.8\",\"exploit\",\"HIGH\",\"news\",\"Security\",\"tapic\",\"Vulnerability\"],\"articleSection\":[\"category_cve\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/zero.redgem.net\\\/?p=52403#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=52403\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/?p=52403\",\"name\":\"xfs: fix freemap adjustments when adding xattrs to leaf blocks_CVE-2026-43158 - zero redgem\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#website\"},\"datePublished\":\"2026-05-08T08:44:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=52403#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/zero.redgem.net\\\/?p=52403\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=52403#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/zero.redgem.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"xfs: fix freemap adjustments when adding xattrs to leaf blocks_CVE-2026-43158\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#website\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/\",\"name\":\"zero redgem\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/zero.redgem.net\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#organization\",\"name\":\"zero redgem\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"\",\"contentUrl\":\"\",\"width\":191,\"height\":188,\"caption\":\"zero redgem\"},\"image\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/person\\\/fbfeae8dfad117ac08a7621bee1a1dca\",\"name\":\"invoker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g\",\"caption\":\"invoker\"},\"sameAs\":[\"https:\\\/\\\/zero.redgem.net\"],\"url\":\"https:\\\/\\\/zero.redgem.net\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"xfs: fix freemap adjustments when adding xattrs to leaf blocks_CVE-2026-43158 - zero redgem","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/zero.redgem.net\/?p=52403","og_locale":"en_US","og_type":"article","og_title":"xfs: fix freemap adjustments when adding xattrs to leaf blocks_CVE-2026-43158 - zero redgem","og_description":"{&#8220;lastseen&#8221;:&#8221;&#8221;,&#8221;description&#8221;:&#8221;In the Linux kernel, the following vulnerability has been resolved:nnxfs: fix freemap adjustments when adding xattrs to leaf blocksnnxfs\/592 and xfs\/794 both trip this assertion...","og_url":"https:\/\/zero.redgem.net\/?p=52403","og_site_name":"zero redgem","article_published_time":"2026-05-08T08:44:25+00:00","author":"invoker","twitter_card":"summary_large_image","twitter_misc":{"Written by":"invoker","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/zero.redgem.net\/?p=52403#article","isPartOf":{"@id":"https:\/\/zero.redgem.net\/?p=52403"},"author":{"name":"invoker","@id":"https:\/\/zero.redgem.net\/#\/schema\/person\/fbfeae8dfad117ac08a7621bee1a1dca"},"headline":"xfs: fix freemap adjustments when adding xattrs to leaf blocks_CVE-2026-43158","datePublished":"2026-05-08T08:44:25+00:00","mainEntityOfPage":{"@id":"https:\/\/zero.redgem.net\/?p=52403"},"wordCount":830,"commentCount":0,"publisher":{"@id":"https:\/\/zero.redgem.net\/#organization"},"keywords":["CVE","CVSS","CVSS-8.8","exploit","HIGH","news","Security","tapic","Vulnerability"],"articleSection":["category_cve"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/zero.redgem.net\/?p=52403#respond"]}]},{"@type":"WebPage","@id":"https:\/\/zero.redgem.net\/?p=52403","url":"https:\/\/zero.redgem.net\/?p=52403","name":"xfs: fix freemap adjustments when adding xattrs to leaf blocks_CVE-2026-43158 - zero redgem","isPartOf":{"@id":"https:\/\/zero.redgem.net\/#website"},"datePublished":"2026-05-08T08:44:25+00:00","breadcrumb":{"@id":"https:\/\/zero.redgem.net\/?p=52403#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zero.redgem.net\/?p=52403"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/zero.redgem.net\/?p=52403#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zero.redgem.net\/"},{"@type":"ListItem","position":2,"name":"xfs: fix freemap adjustments when adding xattrs to leaf blocks_CVE-2026-43158"}]},{"@type":"WebSite","@id":"https:\/\/zero.redgem.net\/#website","url":"https:\/\/zero.redgem.net\/","name":"zero redgem","description":"","publisher":{"@id":"https:\/\/zero.redgem.net\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/zero.redgem.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/zero.redgem.net\/#organization","name":"zero redgem","url":"https:\/\/zero.redgem.net\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/zero.redgem.net\/#\/schema\/logo\/image\/","url":"","contentUrl":"","width":191,"height":188,"caption":"zero redgem"},"image":{"@id":"https:\/\/zero.redgem.net\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/zero.redgem.net\/#\/schema\/person\/fbfeae8dfad117ac08a7621bee1a1dca","name":"invoker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f17c01d7338e6932bcde121cf83569393df3374625d25afd62677cfb528f2e3e?s=96&d=mm&r=g","caption":"invoker"},"sameAs":["https:\/\/zero.redgem.net"],"url":"https:\/\/zero.redgem.net\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts\/52403","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=52403"}],"version-history":[{"count":0,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts\/52403\/revisions"}],"wp:attachment":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=52403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=52403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=52403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}