ext4: check the acl's validity before setting
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 ext4: check the acl's validity before setting
Before setting the acl, call posix_acl_valid() to check if it is valid or not.
--- fs/ext4/acl.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
fs/ext4/acl.c +6 -0
@@ -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 ;
Signature · 1 line
1.6.0.2
Quoted 2 lines · ZhangZhen
Before setting the acl, call
posix_acl_valid()to check if it is valid or not.
Why? posix_acl_xattr_set already does that for you, and it's the only way to feed in an ACL from userspace.
Quoted 9 lines · Christoph Hellwig
Quoted 2 lines · ZhangZhen
Before setting the acl, call
posix_acl_valid()to check if it is valid or not.Why?
posix_acl_xattr_setalready does that for you, and it's the only way to feed in an ACL from userspace.
Hi Hellwig,
You are right, this patch is useless. I'm sorry for this spam mail.
But btrfs_set_acl checks the validity of the ACL too. Should we delete it? Another choice is we can check the validity in every fs tree, and delete the check from posix_acl_xattr_set.
How should we do?
Thanks!
Quoted 5 lines · ZhangZhen
You are right, this patch is useless. I'm sorry for this spam mail.
But
btrfs_set_aclchecks the validity of the ACL too. Should we delete it? Another choice is we can check the validity in every fs tree, and delete the check fromposix_acl_xattr_set.
Doing it in common code is the right thing. I suspect btrfs having it is an oversight, but please verify it with the btrfs maintainers.