crypto: x86/aes-ni - add missing error checks in XTS code
authorArd Biesheuvel <ardb@kernel.org>
Fri, 16 Jul 2021 16:54:03 +0000 (18:54 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 23 Jul 2021 06:49:18 +0000 (14:49 +0800)
commit821720b9f34ec54106ebf012a712ba73bbcf47c2
tree01fa733b27011d0d3b0d72f6d2c3c4050847efb9
parentf03a3cab26c1b7f628a3be6d33ae1b483829b630
crypto: x86/aes-ni - add missing error checks in XTS code

The updated XTS code fails to check the return code of skcipher_walk_virt,
which may lead to skcipher_walk_abort() or skcipher_walk_done() being called
while the walk argument is in an inconsistent state.

So check the return value after each such call, and bail on errors.

Fixes: 2481104fe98d ("crypto: x86/aes-ni-xts - rewrite and drop indirections via glue helper")
Reported-by: Dave Hansen <dave.hansen@intel.com>
Reported-by: syzbot <syzbot+5d1bad8042a8f0e8117a@syzkaller.appspotmail.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/aesni-intel_glue.c