Skip to content

Commit

Permalink
xfs: fix acl count validation in xfs_acl_from_disk()
Browse files Browse the repository at this point in the history
Commit fa8b18e didn't prevent the integer overflow and possible
memory corruption.  "count" can go negative and bypass the check.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
  • Loading branch information
xiw authored and Ben Myers committed Dec 16, 2011
1 parent 687d1c5 commit 093019c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/xfs/xfs_acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 093019c

Please sign in to comment.