summaryrefslogtreecommitdiffstats
path: root/kernel/fs/f2fs/crypto_policy.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fs/f2fs/crypto_policy.c')
-rw-r--r--kernel/fs/f2fs/crypto_policy.c3
1 files changed, 3 insertions, 0 deletions
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;