All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix ftracetest issues
@ 2017-11-25 11:33 Russell King - ARM Linux
  2017-11-25 11:33 ` [PATCH 1/2] ARM: BUG if jumping to usermode address in kernel mode Russell King
                   ` (2 more replies)
  0 siblings, 3 replies; 28+ messages in thread
From: Russell King - ARM Linux @ 2017-11-25 11:33 UTC (permalink / raw)
  To: linux-arm-kernel

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(-)

-- 
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

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2017-12-22  9:55 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-25 11:33 [PATCH 0/2] Fix ftracetest issues Russell King - ARM Linux
2017-11-25 11:33 ` [PATCH 1/2] ARM: BUG if jumping to usermode address in kernel mode Russell King
2017-11-27  1:35   ` Joel Stanley
2017-11-27  9:44     ` Russell King - ARM Linux
2017-11-27 10:16       ` Cédric Le Goater
2017-11-27 10:47         ` Russell King - ARM Linux
2017-11-27 11:50           ` [Qemu-devel] " Peter Maydell
2017-11-27 11:50             ` Peter Maydell
2017-11-27 16:55             ` [Qemu-devel] " Cédric Le Goater
2017-11-27 16:55               ` Cédric Le Goater
2017-11-27 14:27   ` Marek Szyprowski
2017-11-27 14:27     ` Marek Szyprowski
2017-11-27 14:32     ` Russell King - ARM Linux
2017-11-27 14:32       ` Russell King - ARM Linux
2017-11-27 14:37       ` Marek Szyprowski
2017-11-27 14:37         ` Marek Szyprowski
2017-12-08  1:02   ` Alex Shi
2017-12-08  1:02     ` Alex Shi
2017-12-08  6:31     ` Greg KH
2017-12-08  6:31       ` Greg KH
2017-11-25 11:33 ` [PATCH 2/2] ARM: probes: avoid adding kprobes to sensitive kernel-entry/exit code Russell King
2017-12-21 19:40   ` Sam Protsenko
2017-12-22  9:55     ` Russell King - ARM Linux
2017-11-26 15:16 ` [PATCH 0/2] Fix ftracetest issues Alex Shi
2017-11-27 17:25   ` Naresh Kamboju
2017-11-28 13:17     ` Alex Shi
2017-11-28 14:08     ` Naresh Kamboju
2017-12-15 17:40       ` Sam Protsenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.