From: ZhangZhen <zhenzhang.zhang@huawei.com>
To: <tytso@mit.edu>, Jan Kara <jack@suse.cz>
Cc: <linux-ext4@vger.kernel.org>
Subject: [PATCH] ext4: check the acl's validity before setting
Date: Tue, 8 Apr 2014 10:02:50 +0800 [thread overview]
Message-ID: <534358CA.3050808@huawei.com> (raw)
In-Reply-To: <1396922063-4879-1-git-send-email-zhenzhang.zhang@huawei.com>
Before setting the acl, call posix_acl_valid() to check if it is
valid or not.
Signed-off-by: zhang zhen <zhenzhang.zhang@huawei.com>
---
fs/ext4/acl.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/fs/ext4/acl.c b/fs/ext4/acl.c
index d40c8db..97f7650 100644
--- a/fs/ext4/acl.c
+++ b/fs/ext4/acl.c
@@ -197,6 +197,12 @@ __ext4_set_acl(handle_t *handle, struct inode *inode, int type,
size_t size = 0;
int error;
+ if (acl) {
+ error = posix_acl_valid(acl);
+ if (error < 0)
+ return error;
+ }
+
switch (type) {
case ACL_TYPE_ACCESS:
name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS;
--
1.6.0.2
next parent reply other threads:[~2014-04-08 2:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1396922063-4879-1-git-send-email-zhenzhang.zhang@huawei.com>
2014-04-08 2:02 ` ZhangZhen [this message]
2014-04-08 5:46 ` [PATCH] ext4: check the acl's validity before setting Christoph Hellwig
2014-04-08 8:59 ` ZhangZhen
2014-04-08 10:40 ` Christoph Hellwig
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=534358CA.3050808@huawei.com \
--to=zhenzhang.zhang@huawei.com \
--cc=jack@suse.cz \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.edu \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.