]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 08:00:32 +0000 (10:00 +0200)
commitf60827be077bf7a18120494a87088252f4ae62b2
tree264dbdbf44d91f18c87a04f1fb604643e72a6892
parent502bdaac4256a76a86856ec00b1fba2899e83186
crypto: x86/aes-ni - add missing error checks in XTS code

[ Upstream commit 821720b9f34ec54106ebf012a712ba73bbcf47c2 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/x86/crypto/aesni-intel_glue.c