An error occurred while fetching folder content.
lib/mpi: Fix karactx leak in mpi_powm
Herbert Xu authored
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: 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>
3e421061
Name Last commit Last update
..
842 License cleanup: add SPDX GPL-2.0 license identifier to files with no license
fonts Fonts: New Terminus large console font
livepatch livepatch: Proper error handling in the shadow variables selftest
lz4 lib/lz4: update LZ4 decompressor module
lzo lib/lzo: fix bugs for very short or empty input
mpi lib/mpi: Fix karactx leak in mpi_powm
raid6 Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
reed_solomon reed_solomon: Fix kernel-doc
xz lib/xz: Put CRC32_POLY_LE in xz_private.h
zlib_deflate zlib_deflate/deftree: remove bi_reverse()
zlib_inflate lib/zlib_inflate/inflate.c: remove fall through warnings
zstd lib: zstd: clean up Makefile for simpler composite object handling
.gitignore lib: add crc64 calculation routines
Kconfig Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/shli/md into for-linus
Kconfig.debug lib/Kconfig.debug: fix build error without CONFIG_BLOCK
Kconfig.kasan kasan: remove use after scope bugs detection.
Kconfig.kgdb lib: update location of kgdb documentation
Kconfig.ubsan lib/ubsan: default UBSAN_ALIGNMENT to not set
Makefile x86/mm/mem_encrypt: Disable all instrumentation for early SME setup
argv_split.c treewide: kmalloc() -> kmalloc_array()
ashldi3.c move libgcc.h to include/linux
ashrdi3.c move libgcc.h to include/linux
asn1_decoder.c ASN.1: check for error from ASN1_OP_END__ACT actions
assoc_array.c lib/assoc_array.c: mark expected switch fall-through
atomic64.c atomics/generic: Define atomic64_fetch_add_unless()
atomic64_test.c
audit.c
bcd.c
bch.c
bitmap.c
bitrev.c
bsearch.c
btree.c
bucket_locks.c
bug.c
build_OID_registry
bust_spinlocks.c
chacha.c
check_signature.c
checksum.c
clz_ctz.c
clz_tab.c
cmdline.c
cmpdi2.c
compat_audit.c
cordic.c
cpu_rmap.c
cpumask.c
crc-ccitt.c
crc-itu-t.c
crc-t10dif.c
crc16.c
crc32.c
crc32defs.h
crc32test.c
crc4.c
crc64.c
crc7.c
crc8.c
ctype.c
debug_info.c
debug_locks.c
debugobjects.c
dec_and_lock.c
decompress.c
decompress_bunzip2.c
decompress_inflate.c
decompress_unlz4.c
decompress_unlzma.c
decompress_unlzo.c
decompress_unxz.c
devres.c
digsig.c
div64.c
dump_stack.c
dynamic_debug.c
dynamic_queue_limits.c
earlycpio.c
error-inject.c
errseq.c
extable.c
fault-inject.c
fdt.c
fdt_empty_tree.c
fdt_ro.c
fdt_rw.c
fdt_strerror.c
fdt_sw.c
fdt_wip.c
find_bit.c
find_bit_benchmark.c
flex_proportions.c
gcd.c
gen_crc32table.c
gen_crc64table.c
genalloc.c
generic-radix-tree.c
glob.c
globtest.c
hexdump.c