* [PATCH] ext2/3: check the acl's validity before setting
[not found] <1396922030-4800-1-git-send-email-zhenzhang.zhang@huawei.com>
@ 2014-04-08 2:04 ` ZhangZhen
2014-04-08 15:30 ` Theodore Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: ZhangZhen @ 2014-04-08 2:04 UTC (permalink / raw)
To: Jan Kara, tytso; +Cc: linux-ext4
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/ext2/acl.c | 6 ++++++
fs/ext3/acl.c | 6 ++++++
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/fs/ext2/acl.c b/fs/ext2/acl.c
index 27695e6..64b53b8 100644
--- a/fs/ext2/acl.c
+++ b/fs/ext2/acl.c
@@ -189,6 +189,12 @@ ext2_set_acl(struct inode *inode, struct posix_acl *acl, 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 = EXT2_XATTR_INDEX_POSIX_ACL_ACCESS;
diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c
index 8bbaf5b..68f873a 100644
--- a/fs/ext3/acl.c
+++ b/fs/ext3/acl.c
@@ -191,6 +191,12 @@ __ext3_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 = EXT3_XATTR_INDEX_POSIX_ACL_ACCESS;
--
1.6.0.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ext2/3: check the acl's validity before setting
2014-04-08 2:04 ` [PATCH] ext2/3: check the acl's validity before setting ZhangZhen
@ 2014-04-08 15:30 ` Theodore Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2014-04-08 15:30 UTC (permalink / raw)
To: ZhangZhen; +Cc: Jan Kara, linux-ext4
On Tue, Apr 08, 2014 at 10:04:09AM +0800, ZhangZhen wrote:
> 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>
As Christoph noted, this isn't needed since this check is done in the
VFS.
- Ted
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-04-08 15:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1396922030-4800-1-git-send-email-zhenzhang.zhang@huawei.com>
2014-04-08 2:04 ` [PATCH] ext2/3: check the acl's validity before setting ZhangZhen
2014-04-08 15:30 ` Theodore Ts'o
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.