projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
fscrypto: only allow setting encryption policy on directories
[cascardo/linux.git]
/
fs
/
crypto
/
policy.c
diff --git
a/fs/crypto/policy.c
b/fs/crypto/policy.c
index
c9800b1
..
f96547f
100644
(file)
--- a/
fs/crypto/policy.c
+++ b/
fs/crypto/policy.c
@@
-102,6
+102,8
@@
int fscrypt_process_policy(struct inode *inode,
return -EINVAL;
if (!inode_has_encryption_context(inode)) {
+ if (!S_ISDIR(inode->i_mode))
+ return -EINVAL;
if (!inode->i_sb->s_cop->empty_dir)
return -EOPNOTSUPP;
if (!inode->i_sb->s_cop->empty_dir(inode))