From: liu weni <qingshenlwy@gmail.com>
To: viro <viro@zeniv.linux.org.uk>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>
Subject: [PATCHv4 3/3]posix_acl: Add the acl pointer check
Date: Tue, 29 Dec 2009 07:37:02 +0800 [thread overview]
Message-ID: <b3657a100912281537m3bc6b49euebdd75563d4b3cfb@mail.gmail.com> (raw)
In-Reply-To: <b3657a100912281536s7a2ce33en2cae43889b99bfae@mail.gmail.com>
While the acl pointer is IS_ERR, We cannot get the correct return.
And the acl pointer is NULL. Oh, my god! The FOREACH_ACL_ENTRY will
call that.
---
Signed-off-by: Liuwenyi <qingshenlwy@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
diff --git a/fs/posix_acl.c b/fs/posix_acl.c
index 39df95a..4e0261b 100644
--- a/fs/posix_acl.c
+++ b/fs/posix_acl.c
@@ -213,6 +213,12 @@ posix_acl_permission(struct inode *inode, const
struct posix_acl *acl, int want)
const struct posix_acl_entry *pa, *pe, *mask_obj;
int found = 0;
+ if (!acl)
+ return -EINVAL;
+
+ if (IS_ERR(acl))
+ return PTR_ERR(acl);
+
FOREACH_ACL_ENTRY(pa, acl, pe) {
switch(pa->e_tag) {
case ACL_USER_OBJ:
prev parent reply other threads:[~2009-12-28 23:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-28 23:34 [PATCHv4 0/3]posix_acl: Add the acl pointer check liu weni
2009-12-28 23:35 ` [PATCHv4 1/3]posix_acl: " liu weni
2009-12-28 23:36 ` [PATCHv4 2/3]posix_acl: " liu weni
2009-12-28 23:37 ` liu weni [this message]
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=b3657a100912281537m3bc6b49euebdd75563d4b3cfb@mail.gmail.com \
--to=qingshenlwy@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).