linux/fs/pstore
Kees Cook 8665569e97 pstore/ram: Avoid NULL deref in ftrace merging failure path
Given corruption in the ftrace records, it might be possible to allocate
tmp_prz without assigning prz to it, but still marking it as needing to
be freed, which would cause at least a NULL dereference.

smatch warnings:
fs/pstore/ram.c:340 ramoops_pstore_read() error: we previously assumed 'prz' could be null (see line 255)

https://lists.01.org/pipermail/kbuild-all/2018-December/055528.html

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 2fbea82bbb ("pstore: Merge per-CPU ftrace records into one")
Cc: "Joel Fernandes (Google)" <joel@joelfernandes.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
2018-12-03 17:11:02 -08: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
ftrace.c pstore: Fix bool initialization/comparison 2018-12-03 16:52:35 -08:00
inode.c pstore: Map PSTORE_TYPE_* to strings 2018-12-03 16:52:35 -08:00
internal.h pstore: Centralize init/exit routines 2018-10-22 07:11:58 -07:00
platform.c pstore: Convert buf_lock to semaphore 2018-12-03 17:11:02 -08:00
pmsg.c pstore: Create common record initializer 2017-05-31 10:13:44 -07:00
ram.c pstore/ram: Avoid NULL deref in ftrace merging failure path 2018-12-03 17:11:02 -08:00
ram_core.c pstore/ram: Do not treat empty buffers as valid 2018-12-03 16:52:35 -08:00