crypto: api - check for ERR pointers in crypto_destroy_tfm()
stable inclusion from linux-4.19.191 commit 67afaf1a0a3b2e23645c86636d887a7ca84a09ed -------------------------------- [ Upstream commit 83681f2b ] Given that crypto_alloc_tfm() may return ERR pointers, and to avoid crashes on obscure error paths where such pointers are presented to crypto_destroy_tfm() (such as [0]), add an ERR_PTR check there before dereferencing the second argument as a struct crypto_tfm pointer. [0] https://lore.kernel.org/linux-crypto/000000000000de949705bc59e0f6@google.com/ Reported-by:<syzbot+12cf5fbfdeba210a89dd@syzkaller.appspotmail.com> Reviewed-by:
Eric Biggers <ebiggers@google.com> Signed-off-by:
Ard Biesheuvel <ardb@kernel.org> Signed-off-by:
Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Yang Yingliang <yangyingliang@huawei.com>
Loading
Please sign in to comment