summaryrefslogtreecommitdiff
path: root/fs/ext4/crypto_policy.c
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-09-17 02:25:44 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2016-09-17 02:25:44 -0300
commit5b465b045af3a649a89b8a5c5bfdece20ffc0345 (patch)
tree934f851eaec863864e15fa7ef9514a445a9e88ff /fs/ext4/crypto_policy.c
parent0520a938e11c34a5ffc422b9316b85e294b0fbb2 (diff)
Linux-libre 4.7.4-gnupck-4.7.4-gnu
Diffstat (limited to 'fs/ext4/crypto_policy.c')
-rw-r--r--fs/ext4/crypto_policy.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/crypto_policy.c b/fs/ext4/crypto_policy.c
index ad0506981..8a9feb341 100644
--- a/fs/ext4/crypto_policy.c
+++ b/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;