[PATCH] pstore/ram: Avoid NULL deref in ftrace merging failure path

2018-12-03 Thread Kees Cook
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'

[PATCH] pstore/ram: Avoid NULL deref in ftrace merging failure path

2018-12-03 Thread Kees Cook
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'