Skip to content

Fix ftracetest issues

Russell King - ARM Linux linux-arm-kernel linux-samsung-soc qemu-devel stable 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ARM: BUG if jumping to usermode address in kernel mode+0 -01 reply
1/2ARM: BUG if jumping to usermode address in kernel mode+0 -02 replies
1/2ARM: BUG if jumping to usermode address in kernel mode+0 -01 reply
2/2ARM: probes: avoid adding kprobes to sensitive kernel-entry/exit code+0 -00 replies

Reviews trailers per patch

None of the 4 patches has a Reviewed-by or Acked-by.

PatchNaresh KambojuSam Protsenko
SeriesT-b T-b T-b
1/2
1/2
1/2
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] Fix ftracetest issues

ftracetest provokes the kernel to try and return to userspace addresses in kernel mode. These two patches prevent that.

The first patch, which I intend merging with Linus tonight, ensures that we catch the condition before we hit userspace, meaning that there is no possibility of executing user code while in kernel mode.

The second patch fixes the ftracetest issue itself by ensuring that it is not possible to set a kprobe on any of the "special" assembler code. Such code includes:
- the kernel primary/secondary CPU startup code
- exception entry code
- idmap code

This is because the conditions under which this code is executed does not meet the kprobes requirements, which is basically that the "function" is C-like - it does something and then returns to the parent, and has a stack. This is just not universally true of the above code.

This patch is larger than one may desire as we re-organise the sections that some code ends up in, the way the unwinder works, and how we print stack frames.

 arch/arm/include/asm/assembler.h | 18 ++++++++++++++++++
 arch/arm/include/asm/exception.h |  3 +--
 arch/arm/include/asm/sections.h  | 21 +++++++++++++++++++++
 arch/arm/include/asm/traps.h     | 12 ------------
 arch/arm/kernel/entry-armv.S     |  6 +-----
 arch/arm/kernel/entry-common.S   |  1 +
 arch/arm/kernel/entry-header.S   |  6 ++++++
 arch/arm/kernel/stacktrace.c     | 14 ++------------
 arch/arm/kernel/traps.c          |  4 ++--
 arch/arm/kernel/vmlinux.lds.S    |  6 +++---
 arch/arm/mm/fault.c              |  5 ++---
 arch/arm/probes/kprobes/core.c   | 14 +++++++++++---
 12 files changed, 68 insertions(+), 42 deletions(-)
Signature · 3 lines
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up