Re: [PATCH 0/6] fs: fixes for statmount() short buffers and listmount()/listns() cursors
From: Christian Brauner
Date: Wed Oct 21 2026 - 09:20:25 EST
On Wed, 21 Oct 2026 13:46:53 +0200, Christian Brauner wrote:
> shaos reported two issues in [1] and [2]. Both are real.
>
> - statmount() reserves the empty string in the seq buffer before a
> handler runs but the early return for "nothing emitted" never checks
> that byte against the caller's buffer. So ask for STATMOUNT_MNT_UIDMAP
> on a mount that isn't idmapped with a buffer smaller than struct
> statmount and we write one zero byte past the buffer. It's the
> caller's own memory but that's still not ok. I'm fixing this in
> prepare_kstatmount() where the exact-size check already lives so that
> unset strings keep pointing at an empty string.
>
> [...]
Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes 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.fixes
[1/6] statmount: don't copy the reserved empty string past the buffer
https://git.kernel.org/vfs/vfs/c/6410ba49924f
[2/6] selftests/filesystems: check short buffers for statmount() strings
https://git.kernel.org/vfs/vfs/c/4620c3aa7259
[3/6] listmount: don't wrap around with a U64_MAX cursor
https://git.kernel.org/vfs/vfs/c/db1ad1eac126
[4/6] selftests/filesystems: check listmount() with a U64_MAX cursor
https://git.kernel.org/vfs/vfs/c/7d9ebfa4e4fc
[5/6] listns: don't wrap around with a U64_MAX cursor
https://git.kernel.org/vfs/vfs/c/f98c8e0d1536
[6/6] selftests/namespaces: check listns() with a U64_MAX cursor
https://git.kernel.org/vfs/vfs/c/21f54bd8da86