linux-stable/include
Kees Cook ce469db094 pstore/ram: Correctly calculate usable PRZ bytes
[ Upstream commit 89d328f637 ]

The actual number of bytes stored in a PRZ is smaller than the
bytes requested by platform data, since there is a header on each
PRZ. Additionally, if ECC is enabled, there are trailing bytes used
as well. Normally this mismatch doesn't matter since PRZs are circular
buffers and the leading "overflow" bytes are just thrown away. However, in
the case of a compressed record, this rather badly corrupts the results.

This corruption was visible with "ramoops.mem_size=204800 ramoops.ecc=1".
Any stored crashes would not be uncompressable (producing a pstorefs
"dmesg-*.enc.z" file), and triggering errors at boot:

  [    2.790759] pstore: crypto_comp_decompress failed, ret = -22!

Backporting this depends on commit 70ad35db33 ("pstore: Convert console
write to use ->write_buf")

Reported-by: Joel Fernandes <joel@joelfernandes.org>
Fixes: b0aad7a99c ("pstore: Add compression support to pstore")
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-12-17 09:24:39 +01:00
..
acpi
asm-generic vmlinux.lds.h: Fix linker warnings about orphan .LPBX sections 2018-10-12 08:55:29 +11:00
clocksource
crypto crypto: speck - remove Speck 2018-11-13 11:08:46 -08:00
drm drm: Get ref on CRTC commit object when waiting for flip_done 2018-10-18 14:23:13 -04:00
dt-bindings ARM: SoC: late updates 2018-08-25 14:12:36 -07:00
keys
kvm
linux pstore/ram: Correctly calculate usable PRZ bytes 2018-12-17 09:24:39 +01:00
math-emu
media media: cec: fix the Signal Free Time calculation 2018-11-13 11:08:53 -08:00
memory
misc
net netfilter: add missing error handling code for register functions 2018-12-17 09:24:36 +01:00
pcmcia pcmcia: remove long deprecated pcmcia_request_exclusive_irq() function 2018-08-18 12:30:42 -07:00
ras
rdma IB/rxe: Revise the ib_wr_opcode enum 2018-11-13 11:08:43 -08:00
scsi SCSI misc on 20180815 2018-08-15 22:06:26 -07:00
soc soc: fsl: qbman: add APIs to retrieve the probing status 2018-09-27 15:43:35 -05:00
sound ALSA: pcm: Fix interval evaluation with openmin/max 2018-12-13 09:16:16 +01:00
target
trace sched, trace: Fix prev_state output in sched_switch tracepoint 2018-12-08 12:59:06 +01:00
uapi x86/speculation: Add prctl() control for indirect branch speculation 2018-12-05 19:32:04 +01:00
video fbdev changes for v4.19: 2018-08-23 15:44:58 -07:00
xen Revert "xen/balloon: Mark unallocated host memory as UNUSABLE" 2018-12-17 09:24:39 +01:00