Skip to content

Commit

Permalink
f2fs: check the acl's validity before setting
Browse files Browse the repository at this point in the history
Before setting the acl, call posix_acl_valid() to check if it is
valid or not.

Signed-off-by: zhangzhen <[email protected]>
Signed-off-by: Jaegeuk Kim <[email protected]>
  • Loading branch information
ZhangZhen authored and Jaegeuk Kim committed Apr 7, 2014
1 parent 6b4afdd commit 3a8861e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/f2fs/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,12 @@ static int __f2fs_set_acl(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 = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS;
Expand Down

0 comments on commit 3a8861e

Please sign in to comment.