Re: [PATCH v2] ufs: free cylinder group structures on late mount failure
From: Christian Brauner
Date: Wed Nov 18 2026 - 07:41:06 EST
On Thu, 12 Nov 2026 14:40:09 +0800, Joseph Qi wrote:
> ufs_fill_super() reads the cylinder group structures before it creates
> the root dentry, and the two failures that remain after the read, a
> failed ufs_iget() and a failed d_make_root(), jump to a label that only
> frees the in-core superblock information. generic_shutdown_super()
> calls put_super only inside its if (sb->s_root) block, so with s_root
> left NULL the s_csp allocation, the s_ncg buffer heads behind s_ucg[]
> and the UFS_MAX_GROUP_LOADED s_ucpi[] entries are leaked, once per
> mount attempt. Neither failure needs an I/O error: ufs_iget() rejects
> a root inode number outside the s_ncg * s_ipg range the image claims,
> and s_ipg is not validated.
>
> [...]
Applied to the vfs-7.5.misc branch of the vfs/vfs.git tree.
Patches in the vfs-7.5.misc branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.5.misc
[1/1] ufs: free cylinder group structures on late mount failure
https://git.kernel.org/vfs/vfs/c/0f97da93e617