All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -tip v2 0/7] kprobes: Fix %p in kprobes
@ 2018-04-26  8:08 ` Masami Hiramatsu
  0 siblings, 0 replies; 21+ messages in thread
From: Masami Hiramatsu @ 2018-04-26  8:08 UTC (permalink / raw)
  To: linux-kernel, linux-arch
  Cc: Ingo Molnar, H . Peter Anvin, x86, Masami Hiramatsu,
	Ananth N Mavinakayanahalli, Anil S Keshavamurthy,
	David S . Miller, Jon Medhurst, Will Deacon, Arnd Bergmann,
	David Howells, Heiko Carstens, Tobin C . Harding, Linus Torvalds,
	Thomas Richter, akpm, acme, rostedt, brueckner, schwidefsky,
	stable

Hi,

This 2nd version of the series which fixes %p uses in kprobes.
Some by replacing with %pS, some by replacing with %px but
masking with kallsyms_show_value().

V1 series is here:
 https://lkml.org/lkml/2018/1/25/1

I've read the thread about %pK and if I understand correctly
we shouldn't print kernel addresses. However, kprobes debugfs
interface can not stop to show the actual probe address because
it should be compared with addresses in kallsyms for debugging.
So, it depends on that kallsyms_show_value() allows to show
address to user, because if it returns true, anyway that user
can dump /proc/kallsyms.

Other error messages are replaced it with %pS, and one critical
function uses %px which is called right before BUG().

Also, I tried to fix this issue on each arch port. I searched
it by

 # find arch/* | grep -e 'kprobe.*c' | xargs grep -w %p

And fixed all %p uses in those files.

Changes in this version;
 - [1/7] is newly added.
 - patches for MN10300(deleted) and s390(merged) are removed.

Thank you,

---

Masami Hiramatsu (7):
      kprobes: Make blacklist root user read only
      kprobes: Show blacklist addresses as same as kallsyms does
      kprobes: Show address of kprobes if kallsyms does
      kprobes: Replace %p with other pointer types
      kprobes/x86: Fix %p uses in error messages
      kprobes/arm: Fix %p uses in error messages
      kprobes/arm64: Fix %p uses in error messages


 arch/arm/probes/kprobes/core.c      |   10 ++++----
 arch/arm/probes/kprobes/test-core.c |    1 -
 arch/arm64/kernel/probes/kprobes.c  |    4 ++-
 arch/x86/kernel/kprobes/core.c      |   12 +++------
 kernel/kprobes.c                    |   46 ++++++++++++++++++++++-------------
 5 files changed, 40 insertions(+), 33 deletions(-)

--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>

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

end of thread, other threads:[~2018-04-27 14:51 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-26  8:08 [PATCH -tip v2 0/7] kprobes: Fix %p in kprobes Masami Hiramatsu
2018-04-26  8:08 ` Masami Hiramatsu
2018-04-26  8:08 ` [PATCH -tip v2 1/7] kprobes: Make blacklist root user read only Masami Hiramatsu
2018-04-26  8:09 ` [PATCH -tip v2 2/7] kprobes: Show blacklist addresses as same as kallsyms does Masami Hiramatsu
2018-04-26  8:09 ` [PATCH -tip v2 3/7] kprobes: Show address of kprobes if " Masami Hiramatsu
2018-04-26  8:10 ` [PATCH -tip v2 4/7] kprobes: Replace %p with other pointer types Masami Hiramatsu
2018-04-27  1:13   ` Steven Rostedt
2018-04-27  2:39     ` Masami Hiramatsu
2018-04-27  2:48       ` Steven Rostedt
2018-04-27  5:07         ` Masami Hiramatsu
2018-04-26  8:10 ` [PATCH -tip v2 5/7] kprobes/x86: Fix %p uses in error messages Masami Hiramatsu
2018-04-26  8:11 ` [PATCH -tip v2 6/7] kprobes/arm: " Masami Hiramatsu
2018-04-26  8:11 ` [PATCH -tip v2 7/7] kprobes/arm64: " Masami Hiramatsu
2018-04-26  8:13 ` [PATCH -tip v2 0/7] kprobes: Fix %p in kprobes Masami Hiramatsu
2018-04-26  8:40 ` Greg KH
2018-04-27  1:14   ` Steven Rostedt
2018-04-27  6:08     ` Masami Hiramatsu
2018-04-27  6:08       ` Masami Hiramatsu
2018-04-27  6:56     ` Greg KH
2018-04-27 14:51       ` Masami Hiramatsu
2018-04-27 14:51         ` Masami Hiramatsu

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.