xfs: fix acl count validation in xfs_acl_from_disk()
PATCH 1/1 xfs: fix acl count validation in xfs_acl_from_disk()
Commit fa8b18ed didn't prevent the integer overflow and possible memory corruption. "count" can go negative and bypass the check.
Signed-off-by Xi Wang <[email protected]>
--- fs/xfs/xfs_acl.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fs/xfs/xfs_acl.c +1 -1
@@ -39,7 +39,7 @@ xfs_acl_from_disk(struct xfs_acl *aclp)struct posix_acl_entry *acl_e;struct posix_acl *acl;struct xfs_acl_entry *ace; -int count, i; +unsigned int count, i; count =be32_to_cpu (aclp->acl_cnt);if (count >XFS_ACL_MAX_ENTRIES )
Signature · 6 lines
1.7.5.4 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
Quoted 2 lines · Xi Wang
Commit
fa8b18eddidn't prevent the integer overflow and possible memory corruption. "count" can go negative and bypass the check.
Thanks, this looks good to me.
Reviewed-by Christoph Hellwig <[email protected]>
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 4 lines · Xi Wang
Commit
fa8b18eddidn't prevent the integer overflow and possible memory corruption. "count" can go negative and bypass the check.Signed-off-by Xi Wang <[email protected]>
Looks good. Nice catch!
Reviewed-by Ben Myers <[email protected]>
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs