bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kees Cook <keescook@chromium.org>
To: Jann Horn <jannh@google.com>
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
	bpf <bpf@vger.kernel.org>,
	Kernel Hardening <kernel-hardening@lists.openwall.com>
Subject: Re: CONFIG_DEBUG_INFO_BTF and CONFIG_GCC_PLUGIN_RANDSTRUCT
Date: Mon, 30 Mar 2020 10:20:33 -0700	[thread overview]
Message-ID: <202003301016.D0E239A0@keescook> (raw)
In-Reply-To: <CAG48ez0ajun-ujQQqhDRooha1F0BZd3RYKvbJ=8SsRiHAQjUzw@mail.gmail.com>

On Mon, Mar 30, 2020 at 06:17:32PM +0200, Jann Horn wrote:
> On Mon, Mar 30, 2020 at 5:59 PM Alexei Starovoitov
> <alexei.starovoitov@gmail.com> wrote:
> > On Mon, Mar 30, 2020 at 8:14 AM Jann Horn <jannh@google.com> wrote:
> > >
> > > I noticed that CONFIG_DEBUG_INFO_BTF seems to partly defeat the point
> > > of CONFIG_GCC_PLUGIN_RANDSTRUCT.
> >
> > Is it a theoretical stmt or you have data?
> > I think it's the other way around.
> > gcc-plugin breaks dwarf and breaks btf.
> > But I only looked at gcc patches without applying them.
> 
> Ah, interesting - I haven't actually tested it, I just assumed
> (perhaps incorrectly) that the GCC plugin would deal with DWARF info
> properly.

Yeah, GCC appears to create DWARF before the plugin does the
randomization[1], so it's not an exposure, but yes, struct randomization
is pretty completely incompatible with a bunch of things in the kernel
(by design). I'm happy to add negative "depends" in the Kconfig if it
helps clarify anything.

-Kees

[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84052

-- 
Kees Cook

  reply	other threads:[~2020-03-30 17:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-30 15:12 CONFIG_DEBUG_INFO_BTF and CONFIG_GCC_PLUGIN_RANDSTRUCT Jann Horn
2020-03-30 15:59 ` Alexei Starovoitov
2020-03-30 16:17   ` Jann Horn
2020-03-30 17:20     ` Kees Cook [this message]
2020-03-30 22:41       ` Daniel Borkmann
2020-03-31 18:12         ` Kees Cook
2020-03-31 19:50           ` Andrii Nakryiko
2020-03-31 19:58             ` Kees Cook
2020-03-31 20:23               ` Andrii Nakryiko
2020-03-31 21:24                 ` Slava Bacherikov
2020-04-01  7:32                   ` Kees Cook

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=202003301016.D0E239A0@keescook \
    --to=keescook@chromium.org \
    --cc=alexei.starovoitov@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=jannh@google.com \
    --cc=kernel-hardening@lists.openwall.com \
    /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).