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 093019c upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Xi Wang authored and Greg Kroah-Hartman committed Jan 12, 2012
1 parent 68f7609 commit 6e474bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/xfs/linux-2.6/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 6e474bc

Please sign in to comment.