]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fscrypt: clean up some BUG_ON()s in block encryption/decryption
authorEric Biggers <ebiggers@google.com>
Mon, 20 May 2019 16:29:42 +0000 (09:29 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:12:27 +0000 (09:12 +0200)
commit2bff4642593c618e711e8f152b5d9950564c2fe9
tree8841e1e24259172e19dda3dda1fc8b4d7d6d405a
parentbcf628be4a69c4ee4ed55f51ebaff8c565d4daa0
fscrypt: clean up some BUG_ON()s in block encryption/decryption

[ Upstream commit eeacfdc68a104967162dfcba60f53f6f5b62a334 ]

Replace some BUG_ON()s with WARN_ON_ONCE() and returning an error code,
and move the check for len divisible by FS_CRYPTO_BLOCK_SIZE into
fscrypt_crypt_block() so that it's done for both encryption and
decryption, not just encryption.

Reviewed-by: Chandan Rajendra <chandan@linux.ibm.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/crypto/crypto.c