mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 13:11:40 +00:00
ARM: zynq: Use memcpy_toio instead of memcpy on smp bring-up
This fixes a kernel panic on memcpy when FORTIFY_SOURCE is enabled. The initial smp implementation on commitaa7eb2bb4e
("arm: zynq: Add smp support") used memcpy, which worked fine until commitee333554fe
("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:aa7eb2bb4e
("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>
This commit is contained in:
parent
5f595063af
commit
b7005d4ef4
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user