netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Tobin C. Harding" <me@tobin.cc>
To: Kees Cook <keescook@chromium.org>
Cc: kernel-hardening@lists.openwall.com,
	LKML <linux-kernel@vger.kernel.org>,
	Network Development <netdev@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Tycho Andersen <tycho@tycho.ws>
Subject: Re: [RFC 0/3] kallsyms: don't leak address when printing symbol
Date: Tue, 28 Nov 2017 12:50:41 +1100	[thread overview]
Message-ID: <20171128015041.GT17858@eros> (raw)
In-Reply-To: <CAGXu5jK3hJMMrdGQsQxhyLiXhro4DYdpftvtTunM-84PkUeD_Q@mail.gmail.com>

On Mon, Nov 27, 2017 at 04:52:21PM -0800, Kees Cook wrote:
> On Mon, Nov 27, 2017 at 2:30 PM, Tobin C. Harding <me@tobin.cc> wrote:
> > 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).
> 
> If tracing is the only place this is needed, this series seems reasonable to me.

Noob question: how do we _know_ this. In other words how do we know no
userland tools rely on the current behaviour? No stress to answer Kees,
this is a pretty general kernel dev question.

thanks,
Tobin.

  reply	other threads:[~2017-11-28  1:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-27 22:30 [RFC 0/3] kallsyms: don't leak address when printing symbol 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-30  0:16   ` Tobin C. Harding
2017-11-27 22:30 ` [RFC 2/3] vsprintf: print <no-symbol> if " Tobin C. Harding
2017-11-27 22:30 ` [RFC 3/3] trace: print address " Tobin C. Harding
2017-11-28  0:52 ` [RFC 0/3] kallsyms: don't leak address when printing symbol Kees Cook
2017-11-28  1:50   ` Tobin C. Harding [this message]
2017-11-28  3:28     ` [kernel-hardening] " Kaiwan N Billimoria
2017-11-29 23:58       ` Tobin C. Harding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171128015041.GT17858@eros \
    --to=me@tobin.cc \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tycho@tycho.ws \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).