android_kernel_motorola_sm6375/arch/arm64
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Tomislav Novak aadb178c51 hw_breakpoint: fix single-stepping when using bpf_overflow_handler
[ Upstream commit d11a69873d9a7435fe6a48531e165ab80a8b1221 ]

Arm platforms use is_default_overflow_handler() to determine if the
hw_breakpoint code should single-step over the breakpoint trigger or
let the custom handler deal with it.

Since bpf_overflow_handler() currently isn't recognized as a default
handler, attaching a BPF program to a PERF_TYPE_BREAKPOINT event causes
it to keep firing (the instruction triggering the data abort exception
is never skipped). For example:

  # bpftrace -e 'watchpoint:0x10000:4:w { print("hit") }' -c ./test
  Attaching 1 probe...
  hit
  hit
  [...]
  ^C

(./test performs a single 4-byte store to 0x10000)

This patch replaces the check with uses_default_overflow_handler(),
which accounts for the bpf_overflow_handler() case by also testing
if one of the perf_event_output functions gets invoked indirectly,
via orig_default_handler.

Signed-off-by: Tomislav Novak <[email protected]>
Tested-by: Samuel Gosselin <[email protected]> # arm64
Reviewed-by: Catalin Marinas <[email protected]>
Acked-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/linux-arm-kernel/[email protected]/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Will Deacon <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2023-09-23 11:00:03 +02:00
..
boot arm64: dts: qcom: sdm845: Add missing RPMh power domain to GCC 2023-09-23 10:59:45 +02:00
configs
crypto crypto: arm64/gcm - Select AEAD for GHASH_ARM64_CE 2022-08-25 11:17:41 +02:00
include arm64: Fix bit-shifting UB in the MIDR_CPU_MODEL() macro 2023-08-11 11:53:54 +02:00
kernel hw_breakpoint: fix single-stepping when using bpf_overflow_handler 2023-09-23 11:00:03 +02:00
kvm arm64: Use the clearbhb instruction in mitigations 2022-03-19 13:40:15 +01:00
lib
mm arm64: mm: fix VA-range sanity check 2023-07-27 08:37:42 +02:00
net bpf, arm64: Clear prog->jited_len along prog->jited 2022-06-14 18:11:57 +02:00
xen
Kbuild
Kconfig arm64: errata: Remove AES hwcap for COMPAT tasks 2022-10-29 10:20:35 +02:00
Kconfig.debug
Kconfig.platforms irqchip/exiu: Fix acknowledgment of edge triggered interrupts 2022-06-14 18:11:35 +02:00
Makefile