Skip to content

Commit e1436df

Browse files
committed
Revert "ecryptfs: replace BUG_ON with error handling code"
This reverts commit 2c2a755. Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not. Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change. The original commit log for this change was incorrect, no "error handling code" was added, things will blow up just as badly as before if any of these cases ever were true. As this BUG_ON() never fired, and most of these checks are "obviously" never going to be true, let's just revert to the original code for now until this gets unwound to be done correctly in the future. Cc: Aditya Pakki <pakki001@umn.edu> Fixes: 2c2a755 ("ecryptfs: replace BUG_ON with error handling code") Cc: stable <stable@vger.kernel.org> Acked-by: Tyler Hicks <code@tyhicks.com> Link: https://lore.kernel.org/r/20210503115736.2104747-49-gregkh@linuxfoundation.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 5265db2 commit e1436df

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

‎fs/ecryptfs/crypto.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,8 @@ static int crypt_scatterlist(struct ecryptfs_crypt_stat *crypt_stat,
296296
struct extent_crypt_result ecr;
297297
int rc = 0;
298298

299-
if (!crypt_stat || !crypt_stat->tfm
300-
|| !(crypt_stat->flags & ECRYPTFS_STRUCT_INITIALIZED))
301-
return -EINVAL;
302-
299+
BUG_ON(!crypt_stat || !crypt_stat->tfm
300+
|| !(crypt_stat->flags & ECRYPTFS_STRUCT_INITIALIZED));
303301
if (unlikely(ecryptfs_verbosity > 0)) {
304302
ecryptfs_printk(KERN_DEBUG, "Key size [%zd]; key:\n",
305303
crypt_stat->key_size);

0 commit comments

Comments
 (0)