linux-stable/arch/powerpc
Lakshmi Ramasubramanian a45dd984de powerpc: Free fdt on error in elf64_load()
There are a few "goto out;" statements before the local variable "fdt"
is initialized through the call to of_kexec_alloc_and_setup_fdt() in
elf64_load().  This will result in an uninitialized "fdt" being passed
to kvfree() in this function if there is an error before the call to
of_kexec_alloc_and_setup_fdt().

If there is any error after fdt is allocated, but before it is
saved in the arch specific kimage struct, free the fdt.

Fixes: 3c985d31ad ("powerpc: Use common of_kexec_alloc_and_setup_fdt()")
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20210421163610.23775-1-nramas@linux.microsoft.com
2021-04-26 16:27:51 -05:00
..
boot powerpc/boot: Fix build of dts/fsl 2020-12-21 22:06:09 +11:00
configs Modules updates for v5.12 2021-02-23 10:15:33 -08:00
crypto crypto: powerpc/sha256 - remove unneeded semicolon 2021-02-10 17:55:57 +11:00
include powerpc/kexec_file: Restore FDT size estimation for kdump kernel 2021-03-11 09:53:38 -07:00
kernel io_uring-worker.v3-2021-02-25 2021-02-27 08:29:02 -08:00
kexec powerpc: Free fdt on error in elf64_load() 2021-04-26 16:27:51 -05:00
kvm x86: 2021-02-26 10:00:12 -08:00
lib Kbuild updates for v5.12 2021-02-25 10:17:31 -08:00
math-emu
mm powerpc updates for 5.12 2021-02-22 14:34:00 -08:00
net bpf: Rename BPF_XADD and prepare to encode other atomics in .imm 2021-01-14 18:34:29 -08:00
perf powerpc updates for 5.12 2021-02-22 14:34:00 -08:00
platforms idmapped-mounts-v5.12 2021-02-23 13:39:45 -08:00
purgatory powerpc/kexec_file: Enable early kernel OPAL calls 2020-07-29 23:47:55 +10:00
sysdev powerpc/xive: Improve error reporting of OPAL calls 2020-12-11 09:53:11 +11:00
tools powerpc/tools: Remove 90 line limit in checkpatch script 2020-09-08 22:57:11 +10:00
xmon powerpc/32s: mfsrin()/mtsrin() become mfsr()/mtsr() 2021-02-09 01:10:15 +11:00
Kbuild
Kconfig powerpc: Enable passing IMA log to next kernel on kexec 2021-03-08 12:06:29 -07:00
Kconfig.debug powerpc/xmon: Select CONSOLE_POLL for the 8xx 2021-01-31 22:35:51 +11:00
Makefile Kbuild updates for v5.12 2021-02-25 10:17:31 -08:00
Makefile.postlink powerpc: unrel_branch_check.sh: use nm to find symbol value 2020-09-02 11:00:22 +10:00