android_kernel_oneplus_msm8998/arch/arm/mach-mvebu
Ethan Tuttle e4b4dd5003 ARM: mvebu: declare asm symbols as character arrays in pmsu.c
[ Upstream commit d0d378ff451a66e486488eec842e507d28145813 ]

With CONFIG_FORTIFY_SOURCE, memcpy uses the declared size of operands to
detect buffer overflows.  If src or dest is declared as a char, attempts to
copy more than byte will result in a fortify_panic().

Address this problem in mvebu_setup_boot_addr_wa() by declaring
mvebu_boot_wa_start and mvebu_boot_wa_end as character arrays.  Also remove
a couple addressof operators to avoid "arithmetic on pointer to an
incomplete type" compiler error.

See commit 54a7d50b9205 ("x86: mark kprobe templates as character arrays,
not single characters") for a similar fix.

Fixes "detected buffer overflow in memcpy" error during init on some mvebu
systems (armada-370-xp, armada-375):

(fortify_panic) from (mvebu_setup_boot_addr_wa+0xb0/0xb4)
(mvebu_setup_boot_addr_wa) from (mvebu_v7_cpu_pm_init+0x154/0x204)
(mvebu_v7_cpu_pm_init) from (do_one_initcall+0x7c/0x1a8)
(do_one_initcall) from (kernel_init_freeable+0x1bc/0x254)
(kernel_init_freeable) from (kernel_init+0x8/0x114)
(kernel_init) from (ret_from_fork+0x14/0x2c)

Signed-off-by: Ethan Tuttle <ethan@ethantuttle.com>
Tested-by: Ethan Tuttle <ethan@ethantuttle.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-10 08:52:06 +02:00
..
include/mach ARM: mvebu: Simplify headers and make local 2014-02-22 21:19:59 +00:00
armada-370-xp.h ARM: mvebu: Clean-up the Armada XP support 2014-11-22 02:13:24 +00:00
board-v7.c ARM: mvebu: remove the workaround imprecise abort fault handler 2015-10-15 09:21:42 +02:00
coherency.c ARM: mvebu: fix HW I/O coherency related deadlocks 2016-07-27 09:47:39 -07:00
coherency.h ARM: mvebu: Remove the unused argument of set_cpu_coherent() 2014-05-08 16:18:52 +00:00
coherency_ll.S ARM: mvebu: make the coherency_ll.S functions work with no coherency fabric 2014-11-22 01:49:27 +00:00
common.h ARM: mvebu: Add standby support 2015-07-25 17:17:05 +02:00
cpu-reset.c ARM: mvebu: Clean-up the Armada XP support 2014-11-22 02:13:24 +00:00
dove.c ARM: dove: create a proper PMU driver for power domains, PMU IRQs and resets 2015-08-05 18:36:49 +02:00
headsmp-a9.S Remove __cpuinit macros and users. 2015-07-02 09:54:14 -07:00
headsmp.S ARM: mvebu: Split low level functions to manipulate HW coherency 2014-05-08 16:18:54 +00:00
Kconfig ARM: mvebu: Fix broken PL310_ERRATA_753970 selects 2018-03-11 16:19:45 +01:00
kirkwood-pm.c ARM: mvebu: Simplify headers and make local 2014-02-22 21:19:59 +00:00
kirkwood-pm.h ARM: mvebu: Move kirkwood DT boards into mach-mvebu 2014-02-22 21:19:55 +00:00
kirkwood.c ARM: mvebu: remove static LED setup for netxbig boards 2015-11-03 08:59:30 +01:00
kirkwood.h ARM: mvebu: Simplify headers and make local 2014-02-22 21:19:59 +00:00
Makefile ARM: mvebu: remove static LED setup for netxbig boards 2015-11-03 08:59:30 +01:00
mvebu-soc-id.c ARM: mvebu: Use system controller to get the soc id when possible 2014-06-30 17:40:59 +00:00
mvebu-soc-id.h ARM: mvebu: Update the SoC ID and revision definitions 2015-01-09 09:22:53 -06:00
platsmp-a9.c arm/mach-mvebu: remove legacy __cpuinit sections that crept in 2015-06-16 14:12:21 -04:00
platsmp.c mvebu SoC suspend changes for v3.19 2014-12-04 16:46:43 +01:00
pm-board.c ARM: mvebu: Add standby support 2015-07-25 17:17:05 +02:00
pm.c ARM: mvebu: Warn about the wake-up sources not taken into account in suspend 2015-07-28 11:40:47 +02:00
pmsu.c ARM: mvebu: declare asm symbols as character arrays in pmsu.c 2018-10-10 08:52:06 +02:00
pmsu.h mvebu SoC suspend changes for v3.19 2014-12-04 16:46:43 +01:00
pmsu_ll.S mvebu SoC suspend changes for v3.19 2014-12-04 16:46:43 +01:00
system-controller.c ARM: mvebu: build armada375-smp code conditionally 2015-02-18 12:20:29 +01:00