Skip to content

Rework perf and ptrace watchpoint tracking

Benjamin Gray linuxppc-dev 1 version Applied

Status from this message: Applied to powerpc/next.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 3 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/7powerpc/watchpoints: Explain thread_change_pc() morearch/powerpc/kernel/hw_breakpoint.c+4 -00 replies
2/7powerpc/watchpoints: Don't track info persistentlyarch/powerpc/kernel/hw_breakpoint.c+32 -280 replies
3/7powerpc/watchpoints: Track perf single step directly on the breakpointarch/powerpc/include/asm/hw_breakpoint.h arch/powerpc/include/asm/processor.h arch/powerpc/kernel/hw_breakpoint.c+23 -520 replies
4/7powerpc/watchpoints: Simplify watchpoint reinsertionarch/powerpc/kernel/hw_breakpoint.c+1 -110 replies
5/7powerpc/watchpoints: Remove ptrace/perf exclusion trackingarch/powerpc/kernel/hw_breakpoint.c+1 -2480 replies
6/7selftests/powerpc/ptrace: Update ptrace-perf watchpoint selftesttools/testing/selftests/powerpc/ptrace/Makefile tools/testing/selftests/powerpc/ptrace/ptrace-perf-asm.S tools/testing/selftests/powerpc/ptrace/ptrace-perf-hwbreak.c+479 -6590 replies
7/7perf/hw_breakpoint: Remove arch breakpoint hooksinclude/linux/hw_breakpoint.h kernel/events/hw_breakpoint.c+0 -310 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] Rework perf and ptrace watchpoint tracking

Syzkaller triggered a null pointer dereference in the arch_unregister_hw_breakpoint() hook. This is due to accessing the bp->ctx->task field changing to -1 while we iterate the breakpoints.

This series refactors the breakpoint tracking logic to remove the dependency on bp->ctx entirely. It also simplifies handling of ptrace and perf breakpoints, making insertion less restrictive.

If merged, it allows several arch hooks that PowerPC was the sole user of to be removed.

Benjamin Gray (7):
powerpc/watchpoints: Explain thread_change_pc() more powerpc/watchpoints: Don't track info persistently powerpc/watchpoints: Track perf single step directly on the breakpoint powerpc/watchpoints: Simplify watchpoint reinsertion powerpc/watchpoints: Remove ptrace/perf exclusion tracking selftests/powerpc/ptrace: Update ptrace-perf watchpoint selftest perf/hw_breakpoint: Remove arch breakpoint hooks

 arch/powerpc/include/asm/hw_breakpoint.h      |    1 +
 arch/powerpc/include/asm/processor.h          |    5 -
 arch/powerpc/kernel/hw_breakpoint.c           |  388 +-----
 include/linux/hw_breakpoint.h                 |    3 -
 kernel/events/hw_breakpoint.c                 |   28 -
 .../testing/selftests/powerpc/ptrace/Makefile |    1 +
 .../powerpc/ptrace/ptrace-perf-asm.S          |   33 +
 .../powerpc/ptrace/ptrace-perf-hwbreak.c      | 1104 +++++++----------
 8 files changed, 537 insertions(+), 1026 deletions(-)
 create mode 100644 tools/testing/selftests/powerpc/ptrace/ptrace-perf-asm.S

rewrite tools/testing/selftests/powerpc/ptrace/ptrace-perf-hwbreak.c (93%)

Signature · 1 line
2.41.0