linux/arch/arm64
Will Deacon 30b9da0ec2 arm64: ftrace: Ensure module ftrace trampoline is coherent with I-side
commit b6143d10d2 upstream.

The initial support for dynamic ftrace trampolines in modules made use
of an indirect branch which loaded its target from the beginning of
a special section (e71a4e1beb ("arm64: ftrace: add support for far
branches to dynamic ftrace")). Since no instructions were being patched,
no cache maintenance was needed. However, later in be0f272bfc ("arm64:
ftrace: emit ftrace-mod.o contents through code") this code was reworked
to output the trampoline instructions directly into the PLT entry but,
unfortunately, the necessary cache maintenance was overlooked.

Add a call to __flush_icache_range() after writing the new trampoline
instructions but before patching in the branch to the trampoline.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: James Morse <james.morse@arm.com>
Cc: <stable@vger.kernel.org>
Fixes: be0f272bfc ("arm64: ftrace: emit ftrace-mod.o contents through code")
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-08-25 10:48:02 +02:00
..
boot arm64: dts: rockchip: fix isp iommu clocks and power domain 2019-08-06 19:06:47 +02:00
configs arm64: defconfig: Enable TI's AM6 SoC platform 2018-08-29 11:51:26 -07:00
crypto crypto: arm64/sha2-ce - correct digest for empty data in finup 2019-07-26 09:14:19 +02:00
include arm64/mm: fix variable 'pud' set but not used 2019-08-25 10:47:56 +02:00
kernel arm64: ftrace: Ensure module ftrace trampoline is coherent with I-side 2019-08-25 10:48:02 +02:00
kvm arm64: KVM: regmap: Fix unexpected switch fall-through 2019-08-25 10:47:58 +02:00
lib arm64: lse: remove -fcall-used-x0 flag 2018-11-13 11:08:54 -08:00
mm arm64: mm: make CONFIG_ZONE_DMA32 configurable 2019-07-26 09:14:04 +02:00
net bpf, arm64: use more scalable stadd over ldxr / stxr loop in xadd 2019-07-03 13:14:49 +02:00
xen
Kconfig arm64: mm: make CONFIG_ZONE_DMA32 configurable 2019-07-26 09:14:04 +02:00
Kconfig.debug Kconfig: consolidate the "Kernel hacking" menu 2018-08-02 08:06:48 +09:00
Kconfig.platforms ARM: SoC: late updates 2018-08-25 14:12:36 -07:00
Makefile arm64: Don't unconditionally add -Wno-psabi to KBUILD_CFLAGS 2019-07-03 13:14:41 +02:00