All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 0/3] kallsyms: don't leak address when printing symbol
@ 2017-11-27 22:30 ` Tobin C. Harding
  0 siblings, 0 replies; 17+ messages in thread
From: Tobin C. Harding @ 2017-11-27 22:30 UTC (permalink / raw)
  To: kernel-hardening
  Cc: Tobin C. Harding, linux-kernel, Network Development,
	Steven Rostedt, Tycho Andersen

This is an RFC for two reasons.

1) I don't know who this patch set may break?
2) Patch set includes a function that is not called. Function is there
   to facilitate fixing breakages.

_If_ no one gets broken then we can remove the unused function.

Thanks for looking at this.

Currently if a pointer is printed using %p[ssB] and the symbol is not
found (kallsyms_lookup() fails) then we print the actual address. This
potentially leaks kernel addresses. We could instead print something
_safe_. If kallsyms is made to return an error then callers of
sprint_symbol() can decide what to do.

In the case of vsprintf we can print '<no-symbol>' (patch 2).

In the case of trace we want the address so we can check the return code
and print the address if no symbol is found (patch 3).

Design for this set loosely suggested by Steve Rostedt (so as not to
break ftrace).


Patch 1 and 2 tested, patch 3 (trace stuff) untested :)

thanks,
Tobin.

Tobin C. Harding (3):
  kallsyms: don't leak address when symbol not found
  vsprintf: print <no-symbol> if symbol not found
  trace: print address if symbol not found

 include/linux/kernel.h           |  2 ++
 kernel/kallsyms.c                |  6 ++++--
 kernel/trace/trace.h             | 24 ++++++++++++++++++++++++
 kernel/trace/trace_events_hist.c |  6 +++---
 lib/vsprintf.c                   | 18 +++++++++++++++---
 5 files changed, 48 insertions(+), 8 deletions(-)

-- 
2.7.4

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

end of thread, other threads:[~2017-11-30  0:16 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-27 22:30 [RFC 0/3] kallsyms: don't leak address when printing symbol Tobin C. Harding
2017-11-27 22:30 ` [kernel-hardening] " Tobin C. Harding
2017-11-27 22:30 ` [RFC 1/3] kallsyms: don't leak address when symbol not found Tobin C. Harding
2017-11-27 22:30   ` [kernel-hardening] " Tobin C. Harding
2017-11-30  0:16   ` Tobin C. Harding
2017-11-30  0:16     ` [kernel-hardening] " Tobin C. Harding
2017-11-27 22:30 ` [RFC 2/3] vsprintf: print <no-symbol> if " Tobin C. Harding
2017-11-27 22:30   ` [kernel-hardening] " Tobin C. Harding
2017-11-27 22:30   ` Tobin C. Harding
2017-11-27 22:30 ` [RFC 3/3] trace: print address " Tobin C. Harding
2017-11-27 22:30   ` [kernel-hardening] " Tobin C. Harding
2017-11-28  0:52 ` [RFC 0/3] kallsyms: don't leak address when printing symbol Kees Cook
2017-11-28  0:52   ` [kernel-hardening] " Kees Cook
2017-11-28  1:50   ` Tobin C. Harding
2017-11-28  1:50     ` [kernel-hardening] " Tobin C. Harding
2017-11-28  3:28     ` Kaiwan N Billimoria
2017-11-29 23:58       ` Tobin C. Harding

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.