summaryrefslogtreecommitdiffstats
path: root/kernel/fs/f2fs
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fs/f2fs')
-rw-r--r--kernel/fs/f2fs/acl.c6
-rw-r--r--kernel/fs/f2fs/crypto_policy.c3
-rw-r--r--kernel/fs/f2fs/debug.c1
3 files changed, 6 insertions, 4 deletions
diff --git a/kernel/fs/f2fs/acl.c b/kernel/fs/f2fs/acl.c
index c8f25f724..e9a8d676c 100644
--- a/kernel/fs/f2fs/acl.c
+++ b/kernel/fs/f2fs/acl.c
@@ -214,12 +214,10 @@ static int __f2fs_set_acl(struct inode *inode, int type,
case ACL_TYPE_ACCESS:
name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS;
if (acl) {
- error = posix_acl_equiv_mode(acl, &inode->i_mode);
- if (error < 0)
+ error = posix_acl_update_mode(inode, &inode->i_mode, &acl);
+ if (error)
return error;
set_acl_inode(fi, inode->i_mode);
- if (error == 0)
- acl = NULL;
}
break;
diff --git a/kernel/fs/f2fs/crypto_policy.c b/kernel/fs/f2fs/crypto_policy.c
index d4a96af51..e504f548b 100644
--- a/kernel/fs/f2fs/crypto_policy.c
+++ b/kernel/fs/f2fs/crypto_policy.c
@@ -89,6 +89,9 @@ static int f2fs_create_encryption_context_from_policy(
int f2fs_process_policy(const struct f2fs_encryption_policy *policy,
struct inode *inode)
{
+ if (!inode_owner_or_capable(inode))
+ return -EACCES;
+
if (policy->version != 0)
return -EINVAL;
diff --git a/kernel/fs/f2fs/debug.c b/kernel/fs/f2fs/debug.c
index 478e5d541..24d6a51b4 100644
--- a/kernel/fs/f2fs/debug.c
+++ b/kernel/fs/f2fs/debug.c
@@ -352,6 +352,7 @@ static int stat_open(struct inode *inode, struct file *file)
}
static const struct file_operations stat_fops = {
+ .owner = THIS_MODULE,
.open = stat_open,
.read = seq_read,
.llseek = seq_lseek,