Browse Source

f2fs: check the acl's validity before setting

Before setting the acl, call posix_acl_valid() to check if it is
valid or not.

Signed-off-by: zhangzhen <zhenzhang.zhang@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
ZhangZhen 11 years ago
parent
commit
3a8861e271
1 changed files with 6 additions and 0 deletions
  1. 6 0
      fs/f2fs/acl.c

+ 6 - 0
fs/f2fs/acl.c

@@ -203,6 +203,12 @@ static int __f2fs_set_acl(struct inode *inode, int type,
 	size_t size = 0;
 	size_t size = 0;
 	int error;
 	int error;
 
 
+	if (acl) {
+		error = posix_acl_valid(acl);
+		if (error < 0)
+			return error;
+	}
+
 	switch (type) {
 	switch (type) {
 	case ACL_TYPE_ACCESS:
 	case ACL_TYPE_ACCESS:
 		name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS;
 		name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS;