From: Ingo Molnar <mingo@kernel.org>
To: Andy Lutomirski <luto@kernel.org>
Cc: Elena Reshetova <elena.reshetova@intel.com>,
LKML <linux-kernel@vger.kernel.org>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Kees Cook <keescook@chromium.org>, Jann Horn <jannh@google.com>,
"Perla, Enrico" <enrico.perla@intel.com>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Greg KH <gregkh@linuxfoundation.org>
Subject: Re: [PATCH 1/1] x86/entry/64: randomize kernel stack offset upon syscall
Date: Tue, 16 Apr 2019 09:27:44 +0200 [thread overview]
Message-ID: <20190416072744.GB127769@gmail.com> (raw)
In-Reply-To: <CALCETrVme9=aVpSOhtkuVtwDy06pxB=6C9fkqRVoUF_fx0LrOQ@mail.gmail.com>
* Andy Lutomirski <luto@kernel.org> wrote:
> On Wed, Apr 10, 2019 at 4:43 AM Ingo Molnar <mingo@kernel.org> wrote:
> >
> >
> > * Elena Reshetova <elena.reshetova@intel.com> wrote:
> >
> > > 2) Andy's tests, misc-tests: ./timing_test_64 10M sys_enosys
> > > base: 10000000 loops in 1.62224s = 162.22 nsec / loop
> > > random_offset (prandom_u32() every syscall): 10000000 loops in 1.64660s = 166.26 nsec / loop
> >
> > Stupid question, how did you manage to buil timing_test_64? Here it fails
> > with a bog standard gcc 7.3.0 x86-64 distro toolchain:
> >
> > dagon:~/luto-misc-tests.git> make timing_test_64
> > g++ -m64 -o timing_test_64 -O2 -g -std=gnu++11 -pthread -Wall timing_test.cc -lrt -ldl
> > /usr/bin/ld: /tmp/cc8VRkuV.o: relocation R_X86_64_32S against `.text.startup' can not be used when making a PIE object; recompile with -fPIC
> > /usr/bin/ld: final link failed: Nonrepresentable section on outputcollect2: error: ld returned 1 exit status
> > Makefile:39: recipe for target 'timing_test_64' failed
> >
>
> I think your toolchain is screwy. If I create this file as ingo.c:
>
> #include <stdio.h>
>
> int main(int argc, char **argv)
> {
> printf("Hello world!");
>
> return 0;
> }
>
> And build it like this, it fails:
>
> $ gcc -o ingo -g ingo.c -pie
> /usr/bin/ld: /tmp/ccofYU9N.o: relocation R_X86_64_32 against `.rodata'
> can not be used when making a PIE object; recompile with -fPIC
> /usr/bin/ld: final link failed: nonrepresentable section on output
> collect2: error: ld returned 1 exit status
>
> Which I assume means that -pie requires -fPIC, and your toolchain is
> screwed up and is defaulting to useless options. I'm guessing you
> should file a bug against your distro gcc package. For me, it works
> if I remove -pie.
It's just a bog standard Ubuntu x86-64 installation.
Thanks,
Ingo
prev parent reply other threads:[~2019-04-16 7:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-10 11:21 [PATCH 0/1] v2, randomize stack offset upon syscall Elena Reshetova
2019-04-10 11:21 ` [PATCH 1/1] x86/entry/64: randomize kernel " Elena Reshetova
2019-04-10 11:42 ` Ingo Molnar
2019-04-10 14:26 ` Reshetova, Elena
2019-04-10 14:48 ` Andy Lutomirski
2019-04-10 16:20 ` Kees Cook
2019-04-16 7:27 ` Ingo Molnar [this message]
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=20190416072744.GB127769@gmail.com \
--to=mingo@kernel.org \
--cc=bp@alien8.de \
--cc=elena.reshetova@intel.com \
--cc=enrico.perla@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jannh@google.com \
--cc=jpoimboe@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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 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.