{"id":21689,"date":"2026-09-12T04:31:31","date_gmt":"2026-09-11T20:31:31","guid":{"rendered":"https:\/\/www.54iter.cn\/?vuln=cve-2026-89767"},"modified":"2026-09-12T04:31:31","modified_gmt":"2026-09-11T20:31:31","slug":"cve-2026-89767","status":"publish","type":"vuln","link":"https:\/\/www.54iter.cn\/?vuln=cve-2026-89767","title":{"rendered":"CVE-2026-89767 &#8211; In the Linux kernel, the following vulnerability has been resolved:\n\novl: fix double end_c"},"content":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>ovl: fix double end_creating() on the casefold-mismatch path<\/p>\n<p>ovl_create_real() releases the new dentry twice when the casefold<br \/>\nconsistency check fails.  The S_IFDIR branch calls end_creating() and<br \/>\nsets err, then falls through to the common out: label which calls<br \/>\nend_creating() on the same dentry again:<\/p>\n<p>\tcase S_IFDIR:<br \/>\n\t\tnewdentry = ovl_do_mkdir(ofs, dir, newdentry, attr-&gt;mode);<br \/>\n\t\terr = PTR_ERR_OR_ZERO(newdentry);<br \/>\n\t\tif (!err &amp;&amp; ofs-&gt;casefold != ovl_dentry_casefolded(newdentry)) {<br \/>\n\t\t\tpr_warn_ratelimited(&#8230;);<br \/>\n\t\t\tend_creating(newdentry);\t\/* first *\/<br \/>\n\t\t\terr = -EINVAL;<br \/>\n\t\t}<br \/>\n\t\tbreak;<br \/>\n\t&#8230;<br \/>\n\tif (err)<br \/>\n\t\tgoto out;<br \/>\n\t&#8230;<br \/>\n out:<br \/>\n\tif (err) {<br \/>\n\t\tend_creating(newdentry);\t\/* second, same dentry *\/<br \/>\n\t\treturn ERR_PTR(err);<br \/>\n\t}<\/p>\n<p>end_creating() is end_dirop(), which does inode_unlock() on the parent<br \/>\nand dput() on the dentry, so the parent directory&#8217;s i_rwsem is unlocked<br \/>\ntwice and the dentry is put twice.  The second unlock releases a lock<br \/>\nthat is not held, which is what wedges every later creation under that<br \/>\nparent, and the second dput() drops a reference that was never taken.<\/p>\n<p>The branch was added by commit dfc7da402ccc (&#8220;ovl: Check for casefold<br \/>\nconsistency when creating new dentries&#8221;) as a bare dput(), which already<br \/>\nreleased the reference twice; commit fe497f0759e0 (&#8220;VFS: change<br \/>\nvfs_mkdir() to unlock on failure.&#8221;) converted both sites to<br \/>\nend_creating(), adding the double unlock.<\/p>\n<p>This is reachable by an unprivileged user.  The casefold consistency of<br \/>\nthe layers is validated at mount time in ovl_parse_layer(), and again on<br \/>\nevery lookup in ovl_lookup_single(), but ofs-&gt;workdir is the internal<br \/>\n&#8220;work&#8221; subdirectory created inside the user-supplied workdir, and that<br \/>\nsubdirectory is not re-checked.  Marking it casefolded after the mount<br \/>\ntherefore makes every ovl_create_temp() inherit the wrong state &#8211; and<br \/>\nthat path reaches ovl_create_real() through ovl_start_creating_temp(),<br \/>\nwhich uses start_creating() with a generated name and so never runs the<br \/>\nlookup-time check.<\/p>\n<p>  unshare -Urm<br \/>\n  mount -t tmpfs -o casefold=utf8-12.1.0 tmpfs mnt<br \/>\n  mkdir -p mnt\/lower\/d mnt\/upper mnt\/work mnt\/merged<br \/>\n  mount -t overlay ovl -o lowerdir=mnt\/lower,<br \/>\n        upperdir=mnt\/upper,workdir=mnt\/work mnt\/merged<br \/>\n  chattr +F mnt\/work\/work<br \/>\n  mkdir mnt\/merged\/d\/sub\t\t# directory copy-up<\/p>\n<p>  overlayfs: wrong inherited casefold (work\/#5)<\/p>\n<p>and the next copy-up blocks forever on the parent&#8217;s i_rwsem:<\/p>\n<p>  mkdir           D  start_creating+0x65\/0xb0<br \/>\n                     ovl_start_creating_temp+0xb0\/0xe0 [overlay]<br \/>\n                     ovl_create_temp+0xa3\/0x1d0 [overlay]<br \/>\n                     ovl_copy_up_one+0x1f1c\/0x21c0 [overlay]<br \/>\n                     ovl_copy_up_flags+0xf5\/0x140 [overlay]<br \/>\n                     ovl_create_object+0xb7\/0x220 [overlay]<br \/>\n                     ovl_mkdir+0x23\/0x40 [overlay]<\/p>\n<p>Drop the end_creating() from the branch and let out: own the cleanup,<br \/>\nwhich is what every other error path in this function already does.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the Linux kernel, the following vulnerability has been resolved:<\/p>\n<p>ovl: fix double end_creating() on the casefold-mismatch path<\/p>\n<p>ovl_create_real() releases the new dentry twice when the casefold<br \/>\ncon<\/p>\n","protected":false},"template":"","meta":[],"categories":[],"tags":[],"class_list":["post-21689","vuln","type-vuln","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln\/21689","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/vuln"}],"about":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=\/wp\/v2\/types\/vuln"}],"wp:attachment":[{"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=21689"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=21689"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.54iter.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=21689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}