android_kernel_oneplus_msm8998/arch/powerpc
Mahesh Salgaonkar 2dc310f837 powerpc/pseries: Avoid using the size greater than RTAS_ERROR_LOG_MAX.
[ Upstream commit 74e96bf44f430cf7a01de19ba6cf49b361cdfd6e ]

The global mce data buffer that used to copy rtas error log is of 2048
(RTAS_ERROR_LOG_MAX) bytes in size. Before the copy we read
extended_log_length from rtas error log header, then use max of
extended_log_length and RTAS_ERROR_LOG_MAX as a size of data to be copied.
Ideally the platform (phyp) will never send extended error log with
size > 2048. But if that happens, then we have a risk of buffer overrun
and corruption. Fix this by using min_t instead.

Fixes: d368514c30 ("powerpc: Fix corruption when grabbing FWNMI data")
Reported-by: Michal Suchanek <msuchanek@suse.com>
Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-15 09:40:39 +02:00
..
boot powerpc/corenet: explicitly disable the SDHC controller on kmcoge4 2017-11-15 17:13:09 +01:00
configs powerpc updates for 4.4 2015-11-05 23:38:43 -08:00
crypto
include powerpc/fadump: handle crash memory ranges array index overflow 2018-09-09 20:04:32 +02:00
kernel powerpc/fadump: handle crash memory ranges array index overflow 2018-09-09 20:04:32 +02:00
kvm KVM: PPC: Book3S HV: Fix VRMA initialization with 2MB or 1GB memory backing 2018-05-30 07:49:03 +02:00
lib powerpc/lib: Fix off-by-one in alternate feature patching 2018-04-24 09:32:11 +02:00
math-emu
mm powerpc/64s: Fix compiler store ordering to SLB shadow area 2018-08-06 16:24:31 +02:00
net powerpc/bpf/jit: Fix 32-bit JIT for seccomp_data access 2018-05-30 07:49:00 +02:00
oprofile
perf powerpc/perf: Fix kernel address leak via sampling registers 2018-05-30 07:49:10 +02:00
platforms powerpc/pseries: Avoid using the size greater than RTAS_ERROR_LOG_MAX. 2018-09-15 09:40:39 +02:00
sysdev powerpc: Fix size calculation using resource_size() 2018-09-15 09:40:39 +02:00
xmon powerpc/xmon: Add some more elements to the existing PACA dump list 2015-10-15 20:32:02 +11:00
Kconfig powerpc/64s: Wire up cpu_show_meltdown() 2018-02-16 20:09:36 +01:00
Kconfig.debug
Makefile powerpc/cell: Drop CONFIG_TUNE_CELL in favour of CONFIG_CELL_CPU 2015-10-19 19:51:18 +11:00
relocs_check.sh