{"id":51029,"date":"2026-05-03T02:06:21","date_gmt":"2026-05-03T02:06:21","guid":{"rendered":"http:\/\/localhost\/?p=51029"},"modified":"2026-05-03T02:06:21","modified_gmt":"2026-05-03T02:06:21","slug":"ksmbd-validate-numaces-and-harden-ace-walk-in-smbinheritdacl","status":"publish","type":"post","link":"https:\/\/zero.redgem.net\/?p=51029","title":{"rendered":"ksmbd: validate num_aces and harden ACE walk in smb_inherit_dacl()_CVE-2026-31706"},"content":{"rendered":"<p>{&#8220;lastseen&#8221;:&#8221;&#8221;,&#8221;description&#8221;:&#8221;In the Linux kernel, the following vulnerability has been resolved:\\n\\nksmbd: validate num_aces and harden ACE walk in smb_inherit_dacl()\\n\\nsmb_inherit_dacl() trusts the on-disk num_aces value from the parent\\ndirectory&#8217;s DACL xattr and uses it to size a heap allocation:\\n\\n  aces_base = kmalloc(sizeof(struct smb_ace) * num_aces * 2, &#8230;);\\n\\nnum_aces is a u16 read from le16_to_cpu(parent_pdacl-\\u003enum_aces)\\nwithout checking that it is consistent with the declared pdacl_size.\\nAn authenticated client whose parent directory&#8217;s security.NTACL is\\ntampered (e.g. via offline xattr corruption or a concurrent path that\\nbypasses parse_dacl()) can present num_aces = 65535 with minimal\\nactual ACE data.  This causes a ~8 MB allocation (not kzalloc, so\\nuninitialized) that the subsequent loop only partially populates, and\\nmay also overflow the three-way size_t multiply on 32-bit kernels.\\n\\nAdditionally, the ACE walk loop uses the weaker\\noffsetof(struct smb_ace, access_req) minimum size check rather than\\nthe minimum valid on-wire ACE size, and does not reject ACEs whose\\ndeclared size is below the minimum.\\n\\nReproduced on UML + KASAN + LOCKDEP against the real ksmbd code path.\\nA legitimate mount.cifs client creates a parent directory over SMB\\n(ksmbd writes a valid security.NTACL xattr), then the NTACL blob on\\nthe backing filesystem is rewritten to set num_aces = 0xFFFF while\\nkeeping the posix_acl_hash bytes intact so ksmbd_vfs_get_sd_xattr()&#8217;s\\nhash check still passes.  A subsequent SMB2 CREATE of a child under\\nthat parent drives smb2_open() into smb_inherit_dacl() (share has\\n\\&#8221;vfs objects = acl_xattr\\&#8221; set), which fails the page allocator:\\n\\n  WARNING: mm\/page_alloc.c:5226 at __alloc_frozen_pages_noprof+0x46c\/0x9c0\\n  Workqueue: ksmbd-io handle_ksmbd_work\\n   __alloc_frozen_pages_noprof+0x46c\/0x9c0\\n   ___kmalloc_large_node+0x68\/0x130\\n   __kmalloc_large_node_noprof+0x24\/0x70\\n   __kmalloc_noprof+0x4c9\/0x690\\n   smb_inherit_dacl+0x394\/0x2430\\n   smb2_open+0x595d\/0xabe0\\n   handle_ksmbd_work+0x3d3\/0x1140\\n\\nWith the patch applied the added guard rejects the tampered value\\nwith -EINVAL before any large allocation runs, smb2_open() falls back\\nto smb2_create_sd_buffer(), and the child is created with a default\\nSD.  No warning, no splat.\\n\\nFix by:\\n\\n  1. Validating num_aces against pdacl_size using the same formula\\n     applied in parse_dacl().\\n\\n  2. Replacing the raw kmalloc(sizeof * num_aces * 2) with\\n     kmalloc_array(num_aces * 2, sizeof(&#8230;)) for overflow-safe\\n     allocation.\\n\\n  3. Tightening the per-ACE loop guard to require the minimum valid\\n     ACE size (offsetof(smb_ace, sid) + CIFS_SID_BASE_SIZE) and\\n     rejecting under-sized ACEs, matching the hardening in\\n     smb_check_perm_dacl() and parse_dacl().\\n\\nv1 -\\u003e v2:\\n  &#8211; Replace the synthetic test-module splat in the changelog with a\\n    real-path UML + KASAN reproduction driven through mount.cifs and\\n    SMB2 CREATE; Namjae flagged the kcifs3_test_inherit_dacl_old name\\n    in v1 since it does not exist in ksmbd.\\n  &#8211; Drop the commit-hash citation from the code comment per Namjae&#8217;s\\n    review; keep the parse_dacl() pointer.&#8221;,&#8221;published&#8221;:&#8221;2026-05-01T13:56:04.552Z&#8221;,&#8221;modified&#8221;:&#8221;2026-05-03T05:45:29.610Z&#8221;,&#8221;type&#8221;:&#8221;cve&#8221;,&#8221;title&#8221;:&#8221;ksmbd: validate num_aces and harden ACE walk in smb_inherit_dacl()&#8221;,&#8221;source&#8221;:&#8221;Linux&#8221;,&#8221;references&#8221;:&#8221;https:\/\/git.kernel.org\/stable\/c\/063a7409b0de46d7c770b65bb0338e6fdb3b1f0a\\nhttps:\/\/git.kernel.org\/stable\/c\/3e5360b422dd741cb315654a191fa73869a37414\\nhttps:\/\/git.kernel.org\/stable\/c\/59c32abaaec9cdd6164811c7e864e72f7554b82d\\nhttps:\/\/git.kernel.org\/stable\/c\/3e4e2ea2a781018ed5d75f969e3e5606beb66e48&#8243;,&#8221;id&#8221;:&#8221;CVE-2026-31706&#8243;,&#8221;bulletinFamily&#8221;:&#8221;&#8221;,&#8221;cwe&#8221;:null,&#8221;cvelist&#8221;:null,&#8221;sourceData&#8221;:&#8221;Linux Linux e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9\\nLinux Linux e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9\\nLinux Linux e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9\\nLinux Linux e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9\\nLinux Linux 5.15&#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;e2f34481b24db2fd634b5edb0a5bd0e4d38cc6e9&#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\\nksmbd: validate num_aces and harden ACE walk in smb_inherit_dacl()\\n\\nsmb_inherit_dacl() trusts the on-disk num_aces value from the&#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-51029","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>ksmbd: validate num_aces and harden ACE walk in smb_inherit_dacl()_CVE-2026-31706 - 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=51029\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ksmbd: validate num_aces and harden ACE walk in smb_inherit_dacl()_CVE-2026-31706 - 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:nnksmbd: validate num_aces and harden ACE walk in smb_inherit_dacl()nnsmb_inherit_dacl() trusts the on-disk num_aces value from the...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/zero.redgem.net\/?p=51029\" \/>\n<meta property=\"og:site_name\" content=\"zero redgem\" \/>\n<meta property=\"article:published_time\" content=\"2026-05-03T02:06:21+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=51029#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=51029\"},\"author\":{\"name\":\"invoker\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#\\\/schema\\\/person\\\/fbfeae8dfad117ac08a7621bee1a1dca\"},\"headline\":\"ksmbd: validate num_aces and harden ACE walk in smb_inherit_dacl()_CVE-2026-31706\",\"datePublished\":\"2026-05-03T02:06:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=51029\"},\"wordCount\":814,\"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=51029#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=51029\",\"url\":\"https:\\\/\\\/zero.redgem.net\\\/?p=51029\",\"name\":\"ksmbd: validate num_aces and harden ACE walk in smb_inherit_dacl()_CVE-2026-31706 - zero redgem\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/#website\"},\"datePublished\":\"2026-05-03T02:06:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=51029#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/zero.redgem.net\\\/?p=51029\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/zero.redgem.net\\\/?p=51029#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/zero.redgem.net\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ksmbd: validate num_aces and harden ACE walk in smb_inherit_dacl()_CVE-2026-31706\"}]},{\"@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":"ksmbd: validate num_aces and harden ACE walk in smb_inherit_dacl()_CVE-2026-31706 - 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=51029","og_locale":"en_US","og_type":"article","og_title":"ksmbd: validate num_aces and harden ACE walk in smb_inherit_dacl()_CVE-2026-31706 - zero redgem","og_description":"{&#8220;lastseen&#8221;:&#8221;&#8221;,&#8221;description&#8221;:&#8221;In the Linux kernel, the following vulnerability has been resolved:nnksmbd: validate num_aces and harden ACE walk in smb_inherit_dacl()nnsmb_inherit_dacl() trusts the on-disk num_aces value from the...","og_url":"https:\/\/zero.redgem.net\/?p=51029","og_site_name":"zero redgem","article_published_time":"2026-05-03T02:06:21+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=51029#article","isPartOf":{"@id":"https:\/\/zero.redgem.net\/?p=51029"},"author":{"name":"invoker","@id":"https:\/\/zero.redgem.net\/#\/schema\/person\/fbfeae8dfad117ac08a7621bee1a1dca"},"headline":"ksmbd: validate num_aces and harden ACE walk in smb_inherit_dacl()_CVE-2026-31706","datePublished":"2026-05-03T02:06:21+00:00","mainEntityOfPage":{"@id":"https:\/\/zero.redgem.net\/?p=51029"},"wordCount":814,"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=51029#respond"]}]},{"@type":"WebPage","@id":"https:\/\/zero.redgem.net\/?p=51029","url":"https:\/\/zero.redgem.net\/?p=51029","name":"ksmbd: validate num_aces and harden ACE walk in smb_inherit_dacl()_CVE-2026-31706 - zero redgem","isPartOf":{"@id":"https:\/\/zero.redgem.net\/#website"},"datePublished":"2026-05-03T02:06:21+00:00","breadcrumb":{"@id":"https:\/\/zero.redgem.net\/?p=51029#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/zero.redgem.net\/?p=51029"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/zero.redgem.net\/?p=51029#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/zero.redgem.net\/"},{"@type":"ListItem","position":2,"name":"ksmbd: validate num_aces and harden ACE walk in smb_inherit_dacl()_CVE-2026-31706"}]},{"@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\/51029","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=51029"}],"version-history":[{"count":0,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=\/wp\/v2\/posts\/51029\/revisions"}],"wp:attachment":[{"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=51029"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=51029"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zero.redgem.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=51029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}