projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c2facca
)
ext4 crypto: policies may only be set on directories
author
Theodore Ts'o
<tytso@mit.edu>
Sun, 31 May 2015 17:35:14 +0000
(13:35 -0400)
committer
Theodore Ts'o
<tytso@mit.edu>
Sun, 31 May 2015 17:35:14 +0000
(13:35 -0400)
Thanks to Chao Yu <chao2.yu@samsung.com> for pointing out we were
missing this check.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/crypto_policy.c
patch
|
blob
|
blame
|
history
diff --git
a/fs/ext4/crypto_policy.c
b/fs/ext4/crypto_policy.c
index 81980a158dc71e2d298ce92381a57514c6cf4953..a1d434d0dea8f89686e236e18d566500cc7c0185 100644
(file)
--- a/
fs/ext4/crypto_policy.c
+++ b/
fs/ext4/crypto_policy.c
@@
-93,6
+93,8
@@
int ext4_process_policy(const struct ext4_encryption_policy *policy,
return -EINVAL;
if (!ext4_inode_has_encryption_context(inode)) {
+ if (!S_ISDIR(inode->i_mode))
+ return -EINVAL;
if (!ext4_empty_dir(inode))
return -ENOTEMPTY;
return ext4_create_encryption_context_from_policy(inode,