CVE-2026-99174: ext4: free the sbi after a grace period
In the Linux kernel, the following vulnerability has been resolved:
ext4: free the sbi after a grace period
ext4getlink() follows a symlink that keeps its target in a data block in rcu pathwalk mode with ext4getblk(EXT4GETBLOCKSCACHEDNOWAIT). That reads smountstate in the ASSERT() of ext4getblk() and again in ext4eslookupextent(), and the lookup bumps the extent status hit or miss counter, all through sb->sfsinfo.
ext4putsuper() destroys those counters, clears sb->sfsinfo and frees the sbi without waiting for a grace period. A pathwalk that is still in ext4getlink() when the last reference to the mount goes away then dereferences a NULL sfsinfo, the freed sbi or the destroyed percpu counters.
With a pathwalk held up in ext4getlink() while the last reference goes away:
KASAN: null-ptr-deref in range [0x00000000000000a8-0x00000000000000af] RIP: 0010:ext4getblk+0xf0/0x640 Call Trace: <TASK> ext4getlink+0x26c/0x410 picklink+0xf96/0x1780 stepintoslowpath+0x9b8/0x1250 pathlookupat+0x484/0xb00 filenamelookup+0x1f1/0x5b0 vfsstatx+0xd7/0x3b0 vfsfstatat+0x4d/0x90 dosysnewfstatat+0xa0/0x100 dosyscall64+0x10e/0x5e0 entrySYSCALL64afterhwframe+0x77/0x7f
So far that has been hard to hit. umount(2) waits for a grace period in namespaceunlock() before it drops the mount, so only a mount whose last reference goes away elsewhere, like the close of a file or a chdir out of a lazily unmounted directory, can race a walker.
Keep sb->sfsinfo and free the sbi together with the extent status counters after a grace period. Split the counters out of ext4esunregistershrinker() for that. The shrinker still gets wasted in ext4putsuper(), the counters go with the sbi.