mbox series

[0/6] arm64: probes: fixes and cleanup

Message ID 20241008155851.801546-1-mark.rutland@arm.com (mailing list archive)
Headers show
Series arm64: probes: fixes and cleanup | expand

Message

Mark Rutland Oct. 8, 2024, 3:58 p.m. UTC
These patches address some issues I spotted while looking at kprobes and
uprobes.

Patch 1 is the most pressing, as a uprobes user can trigger a kernel
BUG(). Patches 2 and 3 fix latent endianness bugs which only manifest on
big-endian kernels, and patchs 4-6 clean things up so that it's harder
to get this wrong again in future.

Mark.

Mark Rutland (6):
  arm64: probes: Remove broken LDR (literal) uprobe support
  arm64: probes: Fix simulate_ldr*_literal()
  arm64: probes: Fix uprobes for big-endian kernels
  arm64: probes: Move kprobes-specific fields
  arm64: probes: Cleanup kprobes endianness conversions
  arm64: probes: Remove probe_opcode_t

 arch/arm64/include/asm/probes.h          | 11 +++----
 arch/arm64/include/asm/uprobes.h         |  8 ++---
 arch/arm64/kernel/probes/decode-insn.c   | 22 ++++++++-----
 arch/arm64/kernel/probes/decode-insn.h   |  2 +-
 arch/arm64/kernel/probes/kprobes.c       | 39 ++++++++++++------------
 arch/arm64/kernel/probes/simulate-insn.c | 18 +++++------
 arch/arm64/kernel/probes/uprobes.c       |  8 ++---
 7 files changed, 53 insertions(+), 55 deletions(-)

Comments

Will Deacon Oct. 10, 2024, 11:06 a.m. UTC | #1
On Tue, 08 Oct 2024 16:58:45 +0100, Mark Rutland wrote:
> These patches address some issues I spotted while looking at kprobes and
> uprobes.
> 
> Patch 1 is the most pressing, as a uprobes user can trigger a kernel
> BUG(). Patches 2 and 3 fix latent endianness bugs which only manifest on
> big-endian kernels, and patchs 4-6 clean things up so that it's harder
> to get this wrong again in future.
> 
> [...]

Applied first three (fixes) to arm64 (for-next/fixes), thanks!

[1/6] arm64: probes: Remove broken LDR (literal) uprobe support
      https://git.kernel.org/arm64/c/acc450aa0709
[2/6] arm64: probes: Fix simulate_ldr*_literal()
      https://git.kernel.org/arm64/c/50f813e57601
[3/6] arm64: probes: Fix uprobes for big-endian kernels
      https://git.kernel.org/arm64/c/13f8f1e05f1d

Cheers,
Catalin Marinas Oct. 15, 2024, 7 p.m. UTC | #2
On Tue, 08 Oct 2024 16:58:45 +0100, Mark Rutland wrote:
> These patches address some issues I spotted while looking at kprobes and
> uprobes.
> 
> Patch 1 is the most pressing, as a uprobes user can trigger a kernel
> BUG(). Patches 2 and 3 fix latent endianness bugs which only manifest on
> big-endian kernels, and patchs 4-6 clean things up so that it's harder
> to get this wrong again in future.
> 
> [...]

Applied to arm64 (for-next/probes), thanks! The branch also contains the
first three patches in the series from arm64 for-next/fixes.

[4/6] arm64: probes: Move kprobes-specific fields
      https://git.kernel.org/arm64/c/6105c5d46d0b
[5/6] arm64: probes: Cleanup kprobes endianness conversions
      https://git.kernel.org/arm64/c/dd0eb50e7c71
[6/6] arm64: probes: Remove probe_opcode_t
      https://git.kernel.org/arm64/c/14762109de02