From: ZhangZhen Date: Fri, 4 Apr 2014 01:47:16 +0000 (+0800) Subject: f2fs: check the acl's validity before setting X-Git-Tag: v3.15-rc1~62^2~1 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=3a8861e2715e3b985bfaac43bcdfcfebe9b423cb;p=linux-2.6-block.git 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 Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c index a28571528f24..e93e4ec7d165 100644 --- a/fs/f2fs/acl.c +++ b/fs/f2fs/acl.c @@ -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;