Re: [PATCH v2 0/2] ocfs2: validate xattr metadata bounds

Joseph Qi <[email protected]> Tue, 16 Jun 2026 14:46:16 +0800
Newsgroups dev.linux.lists.ocfs2-devel
Message-ID <[email protected]>

On 5/26/26 11:40 AM, Zhang Cen wrote:
> Hi,
> 
> This small series rejects corrupted OCFS2 xattr metadata before the
> getxattr and listxattr paths walk filesystem-controlled inline, external
> block, or indexed bucket storage.
> 
> Patch 1 validates the inline xattr header placement and entry count
> before ocfs2_xattr_ibody_get() parses it. Patch 2 builds on that helper
> and validates listxattr entry counts and name ranges against the storage
> that backs each walk.

Wny not consider move the validation into ocfs2_validate_inode_block() and
ocfs2_validate_xattr_block()?

Thanks,
Joseph

> 
> Both issues were reproduced with crafted OCFS2 images under KASAN.
> 
> v2:
> - Resend as a proper two-patch series. The previous send was malformed
>   by the transport and appeared as a single combined email.
> 
> Zhang Cen (2):
>   ocfs2: validate inline xattr metadata in ocfs2_xattr_ibody_get
>   ocfs2: validate listxattr entry bounds
> 
>  fs/ocfs2/xattr.c | 122 +++++++++++++++++++++++++++++++++++++++--------
>  1 file changed, 101 insertions(+), 21 deletions(-)
>