CVE-2026-72368: cachefiles: Fix double unlock in nomem_d_alloc error path
In the Linux kernel, the following vulnerability has been resolved:
cachefiles: Fix double unlock in nomemdalloc error path
When startcreating() fails and returns -ENOMEM, it has already released the parent directory lock in startdirop():
static struct dentry startdirop(...) { ... inodelocknested(dir, IMUTEXPARENT); dentry = lookuponeqstrexcl(name, parent, lookupflags); if (ISERR(dentry)) inodeunlock(dir); <-- Lock released on error return dentry; }
However, the nomemdalloc error path in cachefilesgetdirectory() unconditionally calls inodeunlock(dinode(dir)) again, causing a double unlock that corrupts the rwsem state.
This is a leftover from commit 7ab96df840e60 which replaced manual locking with startcreating() but failed to update the nomemdalloc path (while correctly updating mkdirerror and lookuperror paths).