X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=fs%2Ff2fs%2Fcrypto_policy.c;h=e504f548b64e3045177ae884b3352ac34bd7466e;hb=7b9a87094a636fc7aab37225c099ad28b3afe9e4;hp=d4a96af513c22f28ea1242496286d4ff1a606567;hpb=82bb70c599d81e6b2535f887b02e1719cc4856ac;p=firefly-linux-kernel-4.4.55.git diff --git a/fs/f2fs/crypto_policy.c b/fs/f2fs/crypto_policy.c index d4a96af513c2..e504f548b64e 100644 --- a/fs/f2fs/crypto_policy.c +++ b/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;