1
0
Fork 0
remarkable-linux/arch/arm64
Daniel Borkmann c43db1a3c7 bpf, arm64: fix stack_depth tracking in combination with tail calls
[ upstream commit a2284d912b ]

Using dynamic stack_depth tracking in arm64 JIT is currently broken in
combination with tail calls. In prologue, we cache ctx->stack_size and
adjust SP reg for setting up function call stack, and tearing it down
again in epilogue. Problem is that when doing a tail call, the cached
ctx->stack_size might not be the same.

One way to fix the problem with minimal overhead is to re-adjust SP in
emit_bpf_tail_call() and properly adjust it to the current program's
ctx->stack_size. Tested on Cavium ThunderX ARMv8.

Fixes: f1c9eed7f4 ("bpf, arm64: take advantage of stack_depth tracking")
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-31 14:03:50 +01:00
..
boot ARM64: dts: marvell: armada-cp110: Fix clock resources for various node 2018-01-23 19:58:16 +01:00
configs ARM/arm64: SoC platform updates for v4.14 2017-09-10 20:35:46 -07:00
crypto License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
include ACPI / APEI: Replace ioremap_page_range() with fixmap 2017-12-25 14:26:20 +01:00
kernel arm64: fpsimd: Prevent registers leaking from dead tasks 2017-12-14 09:53:02 +01:00
kvm arm64: KVM: Fix SMCCC handling of unimplemented SMC/HVC calls 2018-01-23 19:58:20 +01:00
lib License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
mm arm64: fix CONFIG_DEBUG_WX address reporting 2017-12-20 10:10:20 +01:00
net bpf, arm64: fix stack_depth tracking in combination with tail calls 2018-01-31 14:03:50 +01:00
xen xen/privcmd: Add IOCTL_PRIVCMD_DM_OP 2017-02-14 15:13:43 -05:00
Kconfig Merge branch 'arm64/vmap-stack' of git://git.kernel.org/pub/scm/linux/kernel/git/mark/linux into for-next/core 2017-08-15 18:40:58 +01:00
Kconfig.debug arm64: relocation testing module 2017-04-04 17:03:32 +01:00
Kconfig.platforms ARM: arm64: Devicetree updates for v4.14 2017-09-10 20:54:48 -07:00
Makefile arm64: prevent regressions in compressed kernel image size when upgrading to binutils 2.27 2017-12-20 10:10:29 +01:00