From 4612e4ad75ced24be5587989083ee6d47bff9eb4 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Mon, 28 Oct 2024 17:03:30 -0700 Subject: [PATCH] libxfs: validate inumber in xfs_iget Actually use the inumber validator to check the argument passed in here, just like we now do in the kernel. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig --- libxfs/inode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libxfs/inode.c b/libxfs/inode.c index 2062ecf5..9230ad24 100644 --- a/libxfs/inode.c +++ b/libxfs/inode.c @@ -143,7 +143,7 @@ libxfs_iget( int error = 0; /* reject inode numbers outside existing AGs */ - if (!ino || XFS_INO_TO_AGNO(mp, ino) >= mp->m_sb.sb_agcount) + if (!xfs_verify_ino(mp, ino)) return -EINVAL; ip = kmem_cache_zalloc(xfs_inode_cache, 0); -- 2.47.3