{"id":"CVE-2026-99422","state":"PUBLISHED","title":"ovl: use the pinned upper dir in ovl_fix_origin()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\novl: use the pinned upper dir in ovl_fix_origin()\n\nRenames made directly on the upper filesystem during a lookup crash the\nkernel.\n\nA dentry that is passed to vfs_setxattr() must be pinned.\novl_fix_origin() passes upper->d_parent to ovl_set_impure() without a\nreference, and the lookup holds no lock of the upper directory. A\nrename on the upper filesystem changes d_parent, and only the child\npins the new parent, so a second rename and an rmdir free it.\n\nWith delays in ovl_fix_origin() and ovl_set_impure(), renaming the upper\ndirectory twice and removing the intermediate parent during the lookup\nof a merge directory without an origin xattr gave a KASAN\nuse-after-free in vfs_setxattr().\n\nFix this by passing the upper dentry that the overlay parent holds.\n\n[amir: add helper ovl_set_impure_dir()]","publishedAt":"2026-11-19T14:40:24.816Z","updatedAt":"2026-11-22T11:08:08.938Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"9678e630305724487f1fc101d6b83c383ff9cc90","status":"affected","lessThan":"17a540e65e567c8e4dd165a3ce5b592842ba5ab5","versionType":"git"},{"version":"9678e630305724487f1fc101d6b83c383ff9cc90","status":"affected","lessThan":"b219cdaea16b2f3e8e13a63662d462addd8a2cd0","versionType":"git"},{"version":"9678e630305724487f1fc101d6b83c383ff9cc90","status":"affected","lessThan":"77c9b481faacf46b9d9282ffaa71afbac7acf819","versionType":"git"},{"version":"9678e630305724487f1fc101d6b83c383ff9cc90","status":"affected","lessThan":"4f61ff2ebfb3d2967b83b6a4d456242244d5a61f","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/overlayfs/namei.c","fs/overlayfs/overlayfs.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.16","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.16","versionType":"semver"},{"version":"6.12.117","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.61","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.2","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/overlayfs/namei.c","fs/overlayfs/overlayfs.h"]}],"references":["https://git.kernel.org/stable/c/17a540e65e567c8e4dd165a3ce5b592842ba5ab5","https://git.kernel.org/stable/c/b219cdaea16b2f3e8e13a63662d462addd8a2cd0","https://git.kernel.org/stable/c/77c9b481faacf46b9d9282ffaa71afbac7acf819","https://git.kernel.org/stable/c/4f61ff2ebfb3d2967b83b6a4d456242244d5a61f"],"weaknesses":[],"ingestedAt":"2026-11-22T11:18:06.032Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/99xxx/CVE-2026-99422.json","commit":"247cc9beefd85903834df0592e88a44f4d599223","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-99422","state":"PUBLISHED","datePublished":"2026-11-19T14:40:24.816Z","dateUpdated":"2026-11-22T11:08:08.938Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-09-25T10:25:14.413Z"},"containers":{"cna":{"title":"ovl: use the pinned upper dir in ovl_fix_origin()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\novl: use the pinned upper dir in ovl_fix_origin()\n\nRenames made directly on the upper filesystem during a lookup crash the\nkernel.\n\nA dentry that is passed to vfs_setxattr() must be pinned.\novl_fix_origin() passes upper->d_parent to ovl_set_impure() without a\nreference, and the lookup holds no lock of the upper directory. A\nrename on the upper filesystem changes d_parent, and only the child\npins the new parent, so a second rename and an rmdir free it.\n\nWith delays in ovl_fix_origin() and ovl_set_impure(), renaming the upper\ndirectory twice and removing the intermediate parent during the lookup\nof a merge directory without an origin xattr gave a KASAN\nuse-after-free in vfs_setxattr().\n\nFix this by passing the upper dentry that the overlay parent holds.\n\n[amir: add helper ovl_set_impure_dir()]"}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"9678e630305724487f1fc101d6b83c383ff9cc90","status":"affected","lessThan":"17a540e65e567c8e4dd165a3ce5b592842ba5ab5","versionType":"git"},{"version":"9678e630305724487f1fc101d6b83c383ff9cc90","status":"affected","lessThan":"b219cdaea16b2f3e8e13a63662d462addd8a2cd0","versionType":"git"},{"version":"9678e630305724487f1fc101d6b83c383ff9cc90","status":"affected","lessThan":"77c9b481faacf46b9d9282ffaa71afbac7acf819","versionType":"git"},{"version":"9678e630305724487f1fc101d6b83c383ff9cc90","status":"affected","lessThan":"4f61ff2ebfb3d2967b83b6a4d456242244d5a61f","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/overlayfs/namei.c","fs/overlayfs/overlayfs.h"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.16","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.16","versionType":"semver"},{"version":"6.12.117","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.61","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.2","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/overlayfs/namei.c","fs/overlayfs/overlayfs.h"]}],"references":[{"url":"https://git.kernel.org/stable/c/17a540e65e567c8e4dd165a3ce5b592842ba5ab5"},{"url":"https://git.kernel.org/stable/c/b219cdaea16b2f3e8e13a63662d462addd8a2cd0"},{"url":"https://git.kernel.org/stable/c/77c9b481faacf46b9d9282ffaa71afbac7acf819"},{"url":"https://git.kernel.org/stable/c/4f61ff2ebfb3d2967b83b6a4d456242244d5a61f"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - ovl_fix_origin() is called from ovl_lookup() (overlay directory ->lookup, via __lookup_slow() on a path walk) and passes upper->d_parent to ovl_set_impure(). That parent is freed by two rename()s of the upper dentry plus rmdir() of the intermediate directory on the upper filesystem.\nAC:L - The attacker builds a merge directory with no origin xattr, then runs the lookup together with the two upper rename()s and the rmdir(). lookup_one_unlocked() has already dropped the upper directory i_rwsem, and both sides of the race are the attacker's own syscalls.\nPR:L - Search access on the overlay and write access on the upper directory are sufficient. overlayfs sets FS_USERNS_MOUNT, and a userxattr mount in an unprivileged user namespace leaves noxattr false, so ovl_fix_origin() runs on directories that user owns.\nUI:N - The attacker creates the layers, mounts overlay, walks the merge directory into ovl_fix_origin(), and performs the upper rename and rmdir themselves.\nS:U - ovl_set_impure() feeds the freed upper parent to vfs_setxattr() in the kernel that is handling the attacker's lookup and rename, so the corruption is a local kernel privilege escalation.\nC:H - vfs_setxattr() reads dentry->d_inode and the inode's xattr handlers from the upper parent after rmdir has freed that dentry. Reclaiming the dentry-cache object exposes the replacement's kernel pointers to this path.\nI:H - vfs_setxattr() calls inode_lock() and handler->set() on the freed upper parent's d_inode. A reclaimed dentry-cache slot gives that path a kernel write through the corrupted inode.\nA:H - Freeing the unpinned upper parent while ovl_set_impure() is inside vfs_setxattr() is the KASAN use-after-free reported for this bug and oopses on the dead dentry."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-22T11:08:08.938Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.16","versionEndExcluding":"6.12.117"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.16","versionEndExcluding":"6.18.61"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.16","versionEndExcluding":"7.3.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.16","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}