]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ARM: socfpga: Fix crash with CONFIG_FORTIRY_SOURCE
authorTakashi Iwai <tiwai@suse.de>
Thu, 18 Nov 2021 14:25:08 +0000 (15:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Dec 2021 08:27:42 +0000 (09:27 +0100)
commit33712bc6482ef9e4ac13835ebe20f77b4984a8aa
treef42523cf3b0403a4e0b6cffbf8f9b3b9205a6a7a
parent301cdc22d74419c4f1309fcc5011bf041516c7fe
ARM: socfpga: Fix crash with CONFIG_FORTIRY_SOURCE

[ Upstream commit 187bea472600dcc8d2eb714335053264dd437172 ]

When CONFIG_FORTIFY_SOURCE is set, memcpy() checks the potential
buffer overflow and panics.  The code in sofcpga bootstrapping
contains the memcpy() calls are mistakenly translated as the shorter
size, hence it triggers a panic as if it were overflowing.

This patch changes the secondary_trampoline and *_end definitions
to arrays for avoiding the false-positive crash above.

Fixes: 9c4566a117a6 ("ARM: socfpga: Enable SMP for socfpga")
Suggested-by: Kees Cook <keescook@chromium.org>
Buglink: https://bugzilla.suse.com/show_bug.cgi?id=1192473
Link: https://lore.kernel.org/r/20211117193244.31162-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/arm/mach-socfpga/core.h
arch/arm/mach-socfpga/platsmp.c