From: Xi Wang <xi.wang@gmail.com>
To: Christoph Hellwig <hch@lst.de>, Ben Myers <bpm@sgi.com>
Cc: linux-kernel@vger.kernel.org, Xi Wang <xi.wang@gmail.com>,
xfs@oss.sgi.com
Subject: [PATCH] xfs: fix acl count validation in xfs_acl_from_disk()
Date: Mon, 12 Dec 2011 16:55:52 -0500 [thread overview]
Message-ID: <1323726952-22963-1-git-send-email-xi.wang@gmail.com> (raw)
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>
---
fs/xfs/xfs_acl.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c
index 76e4266..ac702a6 100644
--- a/fs/xfs/xfs_acl.c
+++ b/fs/xfs/xfs_acl.c
@@ -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)
--
1.7.5.4
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next reply other threads:[~2011-12-12 21:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-12 21:55 Xi Wang [this message]
2011-12-12 22:42 ` [PATCH] xfs: fix acl count validation in xfs_acl_from_disk() Christoph Hellwig
2011-12-16 21:19 ` Ben Myers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1323726952-22963-1-git-send-email-xi.wang@gmail.com \
--to=xi.wang@gmail.com \
--cc=bpm@sgi.com \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox