From: Darrick J. Wong Date: Fri, 30 Aug 2024 22:36:48 +0000 (-0700) Subject: xfs: validate inumber in xfs_iget X-Git-Tag: xfs-zoned-2024-21-07~522^2~25^2~2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=05aba1953f4a6e2b48e13c610e8a4545ba4ef509;p=users%2Fhch%2Fxfs.git xfs: validate inumber in xfs_iget Actually use the inumber validator to check the argument passed in here. Signed-off-by: Darrick J. Wong Reviewed-by: Christoph Hellwig Reviewed-by: Dave Chinner --- diff --git a/fs/xfs/xfs_icache.c b/fs/xfs/xfs_icache.c index cf629302d48e..887d2a01161e 100644 --- a/fs/xfs/xfs_icache.c +++ b/fs/xfs/xfs_icache.c @@ -755,7 +755,7 @@ xfs_iget( ASSERT((lock_flags & (XFS_IOLOCK_EXCL | XFS_IOLOCK_SHARED)) == 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; XFS_STATS_INC(mp, xs_ig_attempts);