Skip to contentSkip to conversation

xfs: fix acl count validation in xfs_acl_from_disk()

PATCH In review Xi Wang 3 participants 3 messages Dec 12, 2011 – Dec 16, 2011 XFS filesystem

lore
Share & tools
lore

Xi Wang

author
#0 lore raw

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.

---
 fs/xfs/xfs_acl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/xfs/xfs_acl.c +1 -1
index 76e4266..ac702a6 100644
@@ -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