diff options
author | Luis Araneda <luaraneda@gmail.com> | 2019-08-08 08:52:43 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-10-05 15:12:23 +0200 |
commit | 2dcea73cea85bd395fcbc2e491a2c91c90a605a6 (patch) | |
tree | 89d09a07ab32b3f72e1c06f39083c3264dc91b9a /arch/arm/mach-zynq | |
parent | c2d30ffe4cabd6a4bb084304262df6fa282ac069 (diff) | |
download | linux-stable-2dcea73cea85bd395fcbc2e491a2c91c90a605a6.tar.gz linux-stable-2dcea73cea85bd395fcbc2e491a2c91c90a605a6.tar.bz2 linux-stable-2dcea73cea85bd395fcbc2e491a2c91c90a605a6.zip |
ARM: zynq: Use memcpy_toio instead of memcpy on smp bring-up
commit b7005d4ef4f3aa2dc24019ffba03a322557ac43d upstream.
This fixes a kernel panic on memcpy when
FORTIFY_SOURCE is enabled.
The initial smp implementation on commit aa7eb2bb4e4a
("arm: zynq: Add smp support")
used memcpy, which worked fine until commit ee333554fed5
("ARM: 8749/1: Kconfig: Add ARCH_HAS_FORTIFY_SOURCE")
enabled overflow checks at runtime, producing a read
overflow panic.
The computed size of memcpy args are:
- p_size (dst): 4294967295 = (size_t) -1
- q_size (src): 1
- size (len): 8
Additionally, the memory is marked as __iomem, so one of
the memcpy_* functions should be used for read/write.
Fixes: aa7eb2bb4e4a ("arm: zynq: Add smp support")
Signed-off-by: Luis Araneda <luaraneda@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch/arm/mach-zynq')
-rw-r--r-- | arch/arm/mach-zynq/platsmp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-zynq/platsmp.c b/arch/arm/mach-zynq/platsmp.c index a7cfe07156f4..e65ee8180c35 100644 --- a/arch/arm/mach-zynq/platsmp.c +++ b/arch/arm/mach-zynq/platsmp.c @@ -57,7 +57,7 @@ int zynq_cpun_start(u32 address, int cpu) * 0x4: Jump by mov instruction * 0x8: Jumping address */ - memcpy((__force void *)zero, &zynq_secondary_trampoline, + memcpy_toio(zero, &zynq_secondary_trampoline, trampoline_size); writel(address, zero + trampoline_size); |