xfs
[Top] [All Lists]

[PATCHv2 01/12]posix_acl: Add the check items

To: chris.mason@xxxxxxxxxx, viro@xxxxxxxxxxxxxxxxxx, joel.becker@xxxxxxxxxx, cjb@xxxxxxxxxx, jmorris@xxxxxxxxx, serue@xxxxxxxxxx, hch@xxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, adilger@xxxxxxx, jack@xxxxxxx, tytso@xxxxxxx, dwmw2@xxxxxxxxxxxxxă€, swhiteho@xxxxxxxxxx, bfields@xxxxxxxxxxxx, neilb@xxxxxxx, ffilzlnx@xxxxxxxxxx, bharrosh@xxxxxxxxxxx, mfasheh@xxxxxxxx, tiger.yang@xxxxxxxxxx, jeffm@xxxxxxxx, aelder@xxxxxxx, sandeen@xxxxxxxxxxx, xfs-masters@xxxxxxxxxxx, xfs@xxxxxxxxxxx, reiserfs-devel@xxxxxxxxxxxxxxx, ocfs2-devel@xxxxxxxxxxxxxx, linux-nfs@xxxxxxxxxxxxxxx, linux-ext4@xxxxxxxxxxxxxxx, linux-btrfs@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, cluster-devel@xxxxxxxxxx, linux-mtd@xxxxxxxxxxxxxxxxxxx, strongzgy@xxxxxxxxx, onlyflyer@xxxxxxxxx
Subject: [PATCHv2 01/12]posix_acl: Add the check items
From: Liuwenyi <qingshenlwy@xxxxxxxxx>
Date: Mon, 21 Dec 2009 19:52:17 +0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:reply-to :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=r2VOAR2hNvKN7DD6S++sTdEuVUJliMOxMt3mnqizig8=; b=Z4VR95Oxbn0LAwH4gLqGjyMF86SiEnN9x+Rhh1EKqZcjNYS4uYLeGidFi/zA7sYXK+ qcb4cDdkWjjlJ66hg0FtSPgEaMuAuSYUJR+aCz9/AhbLxyjPygUj/ghvJuEIXfdfjv1n 7D2HAUfkDtvw4arAD9Dt9NYvix5PM7tjJkQfI=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=kPpJRPVRLHlmgRzEPrNwyTe4a7Is131sBAHdNiFumpj/aZDLPqb0asObqyTrrIJ5je oG3t8pRM7XlNUg9keJjs4vpSkskQpf+ujG6ENvxpCpYCsXFZMNCSdDYyuLElj6yG1sXT NqA0TkKe2+vPpsLSTjZQdN0qSLvrQgbSU/5XA=
Reply-to: qingshenlwy@xxxxxxxxx
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0
Add the acl validation check-items
to fix the null pointer error and PTR_ERR error.

Thanks for Matthew Wilcox's sguuestion.

---
Signed-off-by: Liuwenyi <qingshenlwy@xxxxxxxxx>
Cc: Chris Mason <chris.mason@xxxxxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Cc: Joel Becker <joel.becker@xxxxxxxxxx>
Cc: Chris Ball <cjb@xxxxxxxxxx>
Cc: James Morris <jmorris@xxxxxxxxx>
Cc: Serge Hallyn <serue@xxxxxxxxxx>
Cc: Christoph Hellwig <hch@xxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Andreas Dilger <adilger@xxxxxxx>
Cc: Jan Kara <jack@xxxxxxx>
Cc: "Theodore Ts'o" <tytso@xxxxxxx>
Cc: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
Cc: Steven Whitehouse <swhiteho@xxxxxxxxxx>
Cc: J. Bruce Fields <bfields@xxxxxxxxxxxx>
Cc: Neil Brown <neilb@xxxxxxx>
Cc: Frank Filz <ffilzlnx@xxxxxxxxxx>
Cc: Boaz Harrosh <bharrosh@xxxxxxxxxxx>
Cc: Mark Fasheh <mfasheh@xxxxxxxx>
Cc: Tiger Yang <tiger.yang@xxxxxxxxxx>
Cc: Jeff Mahoney <jeffm@xxxxxxxx>
Cc: Alex Elder <aelder@xxxxxxx>
Cc: Eric Sandeen <sandeen@xxxxxxxxxxx>
Cc: xfs-masters@xxxxxxxxxxx
Cc: xfs@xxxxxxxxxxx
Cc: reiserfs-devel@xxxxxxxxxxxxxxx
Cc: ocfs2-devel@xxxxxxxxxxxxxx
Cc: linux-nfs@xxxxxxxxxxxxxxx
Cc: linux-ext4@xxxxxxxxxxxxxxx
Cc: linux-btrfs@xxxxxxxxxxxxxxx
Cc: linux-fsdevel@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: cluster-devel@xxxxxxxxxx
Cc: linux-mtd@xxxxxxxxxxxxxxxxxxx

--
diff --git a/fs/posix_acl.c b/fs/posix_acl.c
index 39df95a..d4bacb9 100644
--- a/fs/posix_acl.c
+++ b/fs/posix_acl.c
@@ -76,6 +76,12 @@ posix_acl_valid(const struct posix_acl *acl)
unsigned int id = 0; /* keep gcc happy */
int needs_mask = 0;

+ if (!acl)
+ return -EINVAL;
+
+ if (IS_ERR(acl))
+ return PTR_ERR(acl);
+
FOREACH_ACL_ENTRY(pa, acl, pe) {
if (pa->e_perm & ~(ACL_READ|ACL_WRITE|ACL_EXECUTE))
return -EINVAL;

-- 
Best Regards,
Liuwenyi

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCHv2 01/12]posix_acl: Add the check items, Liuwenyi <=