Linux kernel premature superblock shutdown in delegation waits
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
filelock: keep superblock active through delegation wait
A caller may drop its path after try_break_deleg() returns a delegated inode but before break_deleg_wait() finishes. The extra inode reference held in struct delegated_inode does not keep the superblock active.
After a lazy unmount, closing the delegation holder can release the last mount reference and shut down the superblock while another task waits for the delegation break. The waiter's final iput() can then enter the filesystem's eviction code after its superblock-private state was freed. This has been observed as a KASAN use-after-free in shmem_evict_inode().
When try_break_deleg() saves a delegated inode, take an active reference to its superblock while the caller still pins the mount. Keep that reference through break_deleg_wait() and the final iput(), then release it with deactivate_super(). This protects every caller of the helpers, including the mknod, mkdir, symlink and rmdir paths that drop their path before waiting.
From the CVE record · Linux
The Linux kernel filelock delegation-wait path can use a filesystem inode after its superblock-private state has been freed. This can occur when one task waits for a delegation break while another closes the delegation holder after a lazy unmount; it has been observed as a KASAN use-after-free in shmem_evict_inode(). The input does not establish whether an unprivileged user can trigger the condition.
Operators running Linux kernels should check whether their kernel includes the filelock fix; affected versions were not provided.