linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/8] kprobes: Fix %p in kprobes
@ 2018-01-25  5:26 Masami Hiramatsu
  2018-01-25  5:26 ` Masami Hiramatsu
                   ` (8 more replies)
  0 siblings, 9 replies; 16+ messages in thread
From: Masami Hiramatsu @ 2018-01-25  5:26 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

Hi,

This series fixes %p uses in kprobes. Some by replacing
with %pS, some by replacing with %px but masking with
kallsyms_show_value().

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.

Thank you,

---

Masami Hiramatsu (8):
      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
      kprobes/MN10300: Fix %p uses in error messages
      kprobes/s390: 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/mn10300/kernel/kprobes.c       |    6 +++--
 arch/s390/kernel/kprobes.c          |    2 +-
 arch/x86/kernel/kprobes/core.c      |   12 +++-------
 kernel/kprobes.c                    |   42 ++++++++++++++++++++++-------------
 7 files changed, 41 insertions(+), 36 deletions(-)

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

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

end of thread, other threads:[~2018-01-27 10:15 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-25  5:26 [PATCH 0/8] kprobes: Fix %p in kprobes Masami Hiramatsu
2018-01-25  5:26 ` Masami Hiramatsu
2018-01-25  5:27 ` [PATCH 1/8] kprobes: Show blacklist addresses as same as kallsyms does Masami Hiramatsu
2018-01-25  5:27 ` [PATCH 2/8] kprobes: Show address of kprobes if " Masami Hiramatsu
2018-01-25  5:28 ` [PATCH 3/8] kprobes: Replace %p with other pointer types Masami Hiramatsu
2018-01-25  5:28 ` [PATCH 4/8] kprobes/x86: Fix %p uses in error messages Masami Hiramatsu
2018-01-25  5:29 ` [PATCH 5/8] kprobes/arm: " Masami Hiramatsu
2018-01-25  5:29   ` Masami Hiramatsu
2018-01-25  5:29 ` [PATCH 6/8] kprobes/arm64: " Masami Hiramatsu
2018-01-25 16:42   ` Will Deacon
2018-01-26  5:40     ` Masami Hiramatsu
2018-01-25  5:30 ` [PATCH 7/8] kprobes/MN10300: " Masami Hiramatsu
2018-01-25  5:30 ` [PATCH 8/8] kprobes/s390: " Masami Hiramatsu
2018-01-25  5:30   ` Masami Hiramatsu
2018-01-27 10:15   ` Heiko Carstens
2018-01-27 10:15     ` Heiko Carstens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).