mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/1] x86/kprobes: Prohibit probing of .entry_trampoline code
@ 2018-03-09  3:18 Francis Deslauriers
  2018-03-09  3:18 ` [PATCH 1/1] " Francis Deslauriers
  2018-03-09 15:15 ` [PATCH 0/1] x86/kprobes: Prohibit probing of " Masami Hiramatsu
  0 siblings, 2 replies; 5+ messages in thread
From: Francis Deslauriers @ 2018-03-09  3:18 UTC (permalink / raw)
  To: mhiramat
  Cc: tglx, mingo, peterz, mathieu.desnoyers, linux-kernel,
	Francis Deslauriers

Hi all,

While fuzzing the Perf kprobe interface, I found that adding a probe on
the 'entry_SYSCALL_64_trampoline' symbol will crash my 4.16-rc4
kernel(661e50bc853209e41a5c14a290ca4decc43cbfd1) on a x86_64 Qemu VM.

How to reproduce:
	echo 'p:event1 entry_SYSCALL_64_trampoline' > ./kprobe_events
	echo 1 >  events/kprobes/enable
Crash log:[1]

My understanding is that the userspace CR3 register has not yet been
replaced by the kernel's CR3, when the kprobe is triggered. This means
that the kernel addresses can not be translated, thus making the
handling of the kprobe impossible.

This can be fixed by blacklisting the .entry_trampoline section. See
patch[1/1].

Here is the config I am using[2].

Thanks,

Francis Deslauriers
EfficiOS inc.

1:http://paste.ubuntu.com/p/djnpZCzQKv/
2:http://paste.ubuntu.com/p/3jrFYt6XQB/

Francis Deslauriers (1):
  x86/kprobes: Prohibit probing of .entry_trampoline code

 arch/x86/include/asm/sections.h |  1 +
 arch/x86/kernel/kprobes/core.c  | 10 +++++++++-
 arch/x86/kernel/vmlinux.lds.S   |  2 ++
 3 files changed, 12 insertions(+), 1 deletion(-)

-- 
2.7.4

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

end of thread, other threads:[~2018-03-10  7:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-09  3:18 [PATCH 0/1] x86/kprobes: Prohibit probing of .entry_trampoline code Francis Deslauriers
2018-03-09  3:18 ` [PATCH 1/1] " Francis Deslauriers
2018-03-09 15:17   ` Masami Hiramatsu
2018-03-10  7:07   ` [tip:x86/pti] x86/kprobes: Fix kernel crash when probing " tip-bot for Francis Deslauriers
2018-03-09 15:15 ` [PATCH 0/1] x86/kprobes: Prohibit probing of " Masami Hiramatsu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome