linux/fs/pstore
Pi-Hsun Shih a9fb94a99b pstore: Set tfm to NULL on free_buf_for_compression
Set tfm to NULL on free_buf_for_compression() after crypto_free_comp().

This avoid a use-after-free when allocate_buf_for_compression()
and free_buf_for_compression() are called twice. Although
free_buf_for_compression() freed the tfm, allocate_buf_for_compression()
won't reinitialize the tfm since the tfm pointer is not NULL.

Fixes: 95047b0519 ("pstore: Refactor compression initialization")
Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
Cc: stable@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
2019-05-31 00:32:06 -07:00
..
ftrace.c pstore: Fix bool initialization/comparison 2018-12-03 16:52:35 -08:00
inode.c treewide: Switch printk users from %pf and %pF to %ps and %pS, respectively 2019-04-09 14:19:06 +02:00
internal.h pstore: Centralize init/exit routines 2018-10-22 07:11:58 -07:00
Kconfig mm: remove CONFIG_HAVE_MEMBLOCK 2018-10-31 08:54:15 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
platform.c pstore: Set tfm to NULL on free_buf_for_compression 2019-05-31 00:32:06 -07:00
pmsg.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
ram_core.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
ram.c pstore/ram: Avoid needless alloc during header write 2019-02-12 13:45:53 -08:00