PT-2026-166969

CVE-2026-143111

·

Published

2026-12-03

·

Updated

2026-12-03

Description by

Score
N/A
Not available

No severity ratings or metrics are available. When they are, we'll update the corresponding info on the page.

In the Linux kernel, the following vulnerability has been resolved:
dcache: let d invalidate() wait for a d set mounted() in flight
d invalidate() and d set mounted() are supposed to exclude each other. Either the mount fails with -ENOENT because an ancestor of the mountpoint was unhashed or d invalidate() finds the mountpoint and detaches the mount. d invalidate() unhashes the dentry first and then searches the subtree with d walk() which starts out lockless and only looks at the seqcount of rename lock.
Since d set mounted() switched to read seqlock excl() nothing makes that walk wait or retry:
CPU0: mount on A/M CPU1: d invalidate(A) d set mounted(M) read seqlock excl(&rename lock) A is hashed, go on d drop(A) shrink dcache parent(A) d walk(A, find submount) read seqbegin(&rename lock) M is not a mountpoint need seqretry() == false return M->d flags |= DCACHE MOUNTED return 0 mount gets attached to M
The mount ends up below an unhashed dentry. It can't be reached anymore and pins the subtree until its parent mount or the mount namespace goes away. The window grows with the depth of the mountpoint. With a FUSE directory 3000 levels deep a bind mount racing with FUSE NOTIFY INVAL ENTRY for the parent of the mountpoint survived in 151 of 200 attempts.
Before 5e317d23f6c6 the seqcount bump made the walk wait while d set mounted() ran and retry under the lock when one had run in the meantime. That was the right thing to wait for on the wrong counter: every rename lock reader paid for it, d lookup(), d path(), the ".." step of the RCU walk.
So give d set mounted() a seqlock of its own. It is the only writer and d invalidate() is the only reader. After unhashing the dentry d invalidate() runs an empty read seqbegin()/read seqretry() section on it. That spins while the count is odd, i.e. while a d set mounted() is between its ancestor check and its flag, and goes round once more if one started in the meantime. Nobody else retries anything. The ordering comes from the locks both already take:
  • If that d set mounted() saw the dentry hashed its check ran under the dentry's d lock before d drop() took it. So the count is odd by the time d invalidate() reads it and d invalidate() waits.
  • Once the count is even again the flag has been set under the mountpoint's d lock and the walk takes that lock to look at it.
A d set mounted() that starts after the unhash fails its ancestor check and never touches the flag. So the only flag the walk can pick up belongs to the one mount that saw the dentry hashed and is still in flight, and there is at most one of those because namespace sem serializes mounts. Either it gets attached and detach mounts() takes it off after waiting for namespace sem or it fails later on and drops the flag again. In that case the walk goes round once more and finds nothing. The same goes for the mountpoint that attach recursive mnt() preallocates on the root of the tree it attaches. IOW, d invalidate() does at most one extra round, which the removed-name trap (cf. 1) relies on.
Note that on PREEMPT RT read seqbegin() takes the lock instead of spinning on a preempted d set mounted().
The cost is a seqlock around the ancestor walk for every new mountpoint and two loads of a cacheline that only d set mounted() writes for every d invalidate() of a positive dentry. Walking the ancestors a second time after setting the flag would close the race as well but doubles the cost of d set mounted() with the depth of the mountpoint: about 1us at 64 levels and 75us at 4096 levels.
Vendors
Affected products
Related identifiers
Found an issue in the description? Have something to add? Feel free to write us 👾