Skip to content
Commit 9fbe87fc authored by Herbert Xu's avatar Herbert Xu Committed by Greg Kroah-Hartman
Browse files

lib/mpi: Fix karactx leak in mpi_powm

commit c8ea9fce

 upstream.

Sometimes mpi_powm will leak karactx because a memory allocation
failure causes a bail-out that skips the freeing of karactx.  This
patch moves the freeing of karactx to the end of the function like
everything else so that it can't be skipped.

Reported-by: default avatar <syzbot+f7baccc38dcc1e094e77@syzkaller.appspotmail.com>
Fixes: cdec9cb5

 ("crypto: GnuPG based MPI lib - source files...")
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: default avatarEric Biggers <ebiggers@kernel.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 76cdeea3
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment