{"id":"CVE-2026-99639","summary":"ovl: fix whiteout creation in casefolded directories","details":"In the Linux kernel, the following vulnerability has been resolved:\n\novl: fix whiteout creation in casefolded directories\n\nunlink and rmdir fail with EINVAL on an overlay with casefolded\n(case-insensitive) layers, if the name exists in a lower layer.\nCasefolded layers need CONFIG_UNICODE. Root can mount such an overlay,\nand so can an unprivileged user in a user namespace, with tmpfs layers.\n\nOverlayfs does not change a lower layer. To remove a name that exists\nthere, it hides the name with a marker file, a whiteout. It creates the\nwhiteout in the work directory, a scratch directory on the upper\nfilesystem, and renames it over the name in the upper directory:\n\n- ovl_whiteout() creates the whiteout with mknod, or as a hard link to\n  an earlier whiteout.\n- ovl_cleanup_and_whiteout() then prepares the rename with\n  start_renaming_two_dentries(), which returns -EINVAL if the source or\n  the target dentry is unhashed, that is, not in the dentry hash table.\n\nWith casefolded directories, both dentries can be unhashed:\n\n- The target. Lookup in a casefolded directory leaves a negative dentry\n  unhashed, so the rename target is unhashed if the name does not exist\n  in the upper directory.\n- The source, which is the new whiteout. tmpfs hashes a dentry when\n  mknod or link makes it positive, but ext4 does not, so on ext4 the\n  source is unhashed as well.\n\nThe cleanup after the failure also refuses an unhashed dentry, so on\next4 the whiteout is left behind in the work directory.\n\nReproduced with rm and rmdir on casefolded tmpfs and ext4 layers, also\nas uid 1000 in a user namespace.\n\nFix this by creating the whiteout with ovl_create_temp(), which repeats\nthe lookup if the new dentry is unhashed. Prepare the rename with\nstart_renaming_dentry(), which looks up the target name with the\ndirectories locked. The caller looked the name up without a lock, so\nreturn -ESTALE if the name now refers to a different inode.\n\n[amir: pass the name used for lookup instead of taking a name snapshot]","modified":"2026-11-20T07:00:59.389073408Z","published":"2026-11-20T05:49:55.329Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99639.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/48bd1823237fb076db6e109e35c59b1bc08f550a"},{"type":"WEB","url":"https://git.kernel.org/stable/c/e803c82dcdd15e87b48fca1ea8d2cfe6a7ed83d4"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/99xxx/CVE-2026-99639.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99639"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"833d2b3a072f7ff6005bf84c065c7cbda81a8aaa"},{"fixed":"48bd1823237fb076db6e109e35c59b1bc08f550a"},{"fixed":"e803c82dcdd15e87b48fca1ea8d2cfe6a7ed83d4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-99639.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.5"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-99639.json"}}],"schema_version":"1.9.2"}