summaryrefslogtreecommitdiffstats
path: root/fs/ext4/crypto_policy.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2015-10-03 16:49:27 +0200
committerTheodore Ts'o <tytso@mit.edu>2015-10-03 16:49:27 +0200
commit687c3c36e754a999a8263745b27965128db4fee5 (patch)
treeb2da54484833da41c4d112429becc0ae5df1941e /fs/ext4/crypto_policy.c
parentext4 crypto: ext4_page_crypto() doesn't need a encryption context (diff)
downloadlinux-687c3c36e754a999a8263745b27965128db4fee5.tar.xz
linux-687c3c36e754a999a8263745b27965128db4fee5.zip
ext4 crypto: replace some BUG_ON()'s with error checks
Buggy (or hostile) userspace should not be able to cause the kernel to crash. Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: stable@vger.kernel.org
Diffstat (limited to 'fs/ext4/crypto_policy.c')
-rw-r--r--fs/ext4/crypto_policy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext4/crypto_policy.c b/fs/ext4/crypto_policy.c
index a640ec2c4b13..ad050698143f 100644
--- a/fs/ext4/crypto_policy.c
+++ b/fs/ext4/crypto_policy.c
@@ -150,7 +150,8 @@ int ext4_is_child_context_consistent_with_parent(struct inode *parent,
if ((parent == NULL) || (child == NULL)) {
pr_err("parent %p child %p\n", parent, child);
- BUG_ON(1);
+ WARN_ON(1); /* Should never happen */
+ return 0;
}
/* no restrictions if the parent directory is not encrypted */
if (!ext4_encrypted_inode(parent))