]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit52a8fdac9d485cf3d87ad1775fc84e54e308cb40
tree01fa733b27011d0d3b0d72f6d2c3c4050847efb9
parent6e37942c1c9c09f5c3b3f5cfe7b4443e2e2624d5
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: 2136f9e71688 ("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