linux-brain/fs/pstore
Kees Cook 6c22e4aea4 pstore/ram: Avoid NULL deref in ftrace merging failure path
[ Upstream commit 8665569e97 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-17 20:38:34 +01:00
..
Kconfig docs: fix locations of several documents that got moved 2016-10-24 08:12:35 -02: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: Remove write_buf() callback 2017-03-07 14:01:02 -08:00
inode.c Revert "pstore: Honor dmesg_restrict sysctl on dmesg dumps" 2017-08-17 16:29:19 -07:00
internal.h 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/ram: Run without kernel crash dump region 2019-06-11 12:21:48 +02: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 2019-12-17 20:38:34 +01:00
ram_core.c pstore/ram: Do not treat empty buffers as valid 2019-01-26 09:37:02 +01:00