From: "Liuweni" <qingshenlwy@gmail.com>
To: "linux-fsdevel" <linux-fsdevel@vger.kernel.org>,
"linux-kernel" <linux-kernel@vger.kernel.org>,
"viro" <viro@zeniv.linux.org.uk>
Cc: "strongzgy" <strongzgy@gmail.com>,
"Xiao Guangrong" <xiaoguangrong@cn.fujitsu.com>,
"Liu Hui" <onlyflyer@gmail.com>,
"qingshenlwy" <qingshenlwy@gmail.com>
Subject: [PATCH 2/3]posix acl:Add an acl check
Date: Thu, 17 Dec 2009 22:24:10 +0800 [thread overview]
Message-ID: <200912172224077656512@gmail.com> (raw)
In this function, the parameter of acl will be called by FOREACH_ACL_ENTRY(macro)
without null pointer check.
I add a Null point checker to it.
In the fs/btrfs/btrfs_acl.c, the posix_acl_equiv_mode will make a error by null pointer.
---
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..37d0485 100644
--- a/fs/posix_acl.c
+++ b/fs/posix_acl.c
@@ -150,6 +150,9 @@ posix_acl_equiv_mode(const struct posix_acl *acl, mode_t *mode_p)
mode_t mode = 0;
int not_equiv = 0;
+ if(!acl)
+ return -EINVAL;
+
FOREACH_ACL_ENTRY(pa, acl, pe) {
switch (pa->e_tag) {
case ACL_USER_OBJ:
--------------
Best Regards,
Liuweni
2009-12-17
reply other threads:[~2009-12-17 14:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200912172224077656512@gmail.com \
--to=qingshenlwy@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=onlyflyer@gmail.com \
--cc=strongzgy@gmail.com \
--cc=viro@zeniv.linux.org.uk \
--cc=xiaoguangrong@cn.fujitsu.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;
as well as URLs for NNTP newsgroup(s).