From: liu weni <qingshenlwy@gmail.com>
To: "Américo Wang" <xiyou.wangcong@gmail.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCHv3 1/3]posix_acl: add the pointer check into fs/posix_acl.c
Date: Tue, 29 Dec 2009 07:29:05 +0800 [thread overview]
Message-ID: <b3657a100912281529t7a21d0c8v14d34c18b5a8207f@mail.gmail.com> (raw)
In-Reply-To: <20091228153236.GB10490@hack>
Sorry. I forgot diff it again.
2009/12/28 Américo Wang <xiyou.wangcong@gmail.com>:
> On Mon, Dec 28, 2009 at 11:00:58PM +0800, liu weni wrote:
>>If the acl pointer is NULL or have some error, the acl is invalid.
>>The Macro of FOREACH_ACL_ENTRY will make some error.
>>
>>---
>>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..45f8afa 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)
>
> Did you even do a compile test?
> I don't think this line will work...
>
>
>>+ return PTR_ERR(acl);
>>+
>> FOREACH_ACL_ENTRY(pa, acl, pe) {
>> if (pa->e_perm & ~(ACL_READ|ACL_WRITE|ACL_EXECUTE))
>> return -EINVAL;
>>--
>>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>>the body of a message to majordomo@vger.kernel.org
>>More majordomo info at http://vger.kernel.org/majordomo-info.html
>>Please read the FAQ at http://www.tux.org/lkml/
>
> --
> Live like a child, think like the god.
>
>
prev parent reply other threads:[~2009-12-28 23:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-28 14:59 [PATCHv3 0/3]posix_acl: add the pointer check into fs/posix_acl.c liu weni
2009-12-28 15:00 ` [PATCHv3 1/3]posix_acl: " liu weni
2009-12-28 15:01 ` [PATCHv3 2/3]posix_acl: " liu weni
2009-12-28 15:02 ` [PATCHv3 3/3]posix_acl: " liu weni
2009-12-28 15:32 ` [PATCHv3 1/3]posix_acl: " Américo Wang
2009-12-28 23:29 ` 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=b3657a100912281529t7a21d0c8v14d34c18b5a8207f@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 \
--cc=xiyou.wangcong@gmail.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).