Message ID | 20180302222113.85389-3-ebiggers3@gmail.com |
---|---|
State | Not Applicable, archived |
Headers | show |
Series | [4.1,1/3] ext4: require encryption feature for EXT4_IOC_SET_ENCRYPTION_POLICY | expand |
diff --git a/fs/ext4/crypto_policy.c b/fs/ext4/crypto_policy.c index a6d6291aea16..591fc37dcd9e 100644 --- a/fs/ext4/crypto_policy.c +++ b/fs/ext4/crypto_policy.c @@ -85,6 +85,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;