summaryrefslogtreecommitdiffstats
path: root/kernel/fs/ext4/crypto_policy.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fs/ext4/crypto_policy.c')
-rw-r--r--kernel/fs/ext4/crypto_policy.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/fs/ext4/crypto_policy.c b/kernel/fs/ext4/crypto_policy.c
index ad0506981..8a9feb341 100644
--- a/kernel/fs/ext4/crypto_policy.c
+++ b/kernel/fs/ext4/crypto_policy.c
@@ -102,6 +102,9 @@ static int ext4_create_encryption_context_from_policy(
int ext4_process_policy(const struct ext4_encryption_policy *policy,
struct inode *inode)
{
+ if (!inode_owner_or_capable(inode))
+ return -EACCES;
+
if (policy->version != 0)
return -EINVAL;