]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
xfs: fix acl count validation in xfs_acl_from_disk()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 26 Jan 2012 13:55:16 +0000 (16:55 +0300)
committerGuru Anbalagane <guru.anbalagane@oracle.com>
Wed, 1 Feb 2012 07:26:37 +0000 (23:26 -0800)
We applied a fix for CVE-2012-0038 fa8b18edd7 "xfs: validate acl count",
but there was a follow on patch which is not in our kernel.  If count
was a negative then we could get by the new check.

From 093019cf1b18dd31b2c3b77acce4e000e2cbc9ce Mon Sep 17 00:00:00 2001
From: Xi Wang <xi.wang@gmail.com>
Date: Mon, 12 Dec 2011 21:55:52 +0000
Subject: [PATCH] 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 <xi.wang@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
fs/xfs/linux-2.6/xfs_acl.c

index 4b9fb915d445507d3eb4074d10c1a1315db69e88..f86e03487866b767b4b74687eec5b843f6699bee 100644 (file)
@@ -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)