From: Josh Poimboeuf <jpoimboe@redhat.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
David Woodhouse <dwmw@amazon.co.uk>,
Andi Kleen <ak@linux.intel.com>, Paul Turner <pjt@google.com>,
LKML <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linux-foundation.org>,
Tim Chen <tim.c.chen@linux.intel.com>,
Dave Hansen <dave.hansen@intel.com>,
Kees Cook <keescook@google.com>, Rik van Riel <riel@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Andy Lutomirski <luto@amacapital.net>,
Jiri Kosina <jikos@kernel.org>,
gnomes@lxorguk.ukuu.org.uk
Subject: Re: [PATCH v6 01/10] x86/retpoline: Add initial retpoline support
Date: Mon, 8 Jan 2018 15:20:46 -0600 [thread overview]
Message-ID: <20180108212046.3wkqerxkellnqudy@treble> (raw)
In-Reply-To: <f09d496d272fcf20b3ed5c2b0a2aae3c.squirrel@twosheds.infradead.org>
On Mon, Jan 08, 2018 at 02:26:11PM -0000, David Woodhouse wrote:
>
> > On Mon, Jan 08, 2018 at 02:46:32PM +0100, Thomas Gleixner wrote:
> >> On Mon, 8 Jan 2018, Josh Poimboeuf wrote:
> >> > On Sun, Jan 07, 2018 at 10:11:16PM +0000, David Woodhouse wrote:
> >> > > diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> >> > > index a20eacd..918e550 100644
> >> > > --- a/arch/x86/Makefile
> >> > > +++ b/arch/x86/Makefile
> >> > > @@ -235,6 +235,16 @@ KBUILD_CFLAGS += -Wno-sign-compare
> >> > > #
> >> > > KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
> >> > >
> >> > > +# Avoid indirect branches in kernel to deal with Spectre
> >> > > +ifdef CONFIG_RETPOLINE
> >> > > + RETPOLINE_CFLAGS += $(call
> >> cc-option,-mindirect-branch=thunk-extern -mindirect-branch-register)
> >> > > + ifneq ($(RETPOLINE_CFLAGS),)
> >> > > + KBUILD_CFLAGS += $(RETPOLINE_CFLAGS) -DRETPOLINE
> >> > > + else
> >> > > + $(warning Retpoline not supported in compiler. System may
> >> be insecure.)
> >> > > + endif
> >> > > +endif
> >> >
> >> > I wonder if an error might be more appropriate than a warning. I
> >> > learned from experience that a lot of people don't see these Makefile
> >> > warnings, and this would be a dangerous one to miss.
> >> >
> >> > Also if this were an error, you could get rid of the RETPOLINE define,
> >> > and that would be one less define cluttering up the already
> >> way-too-long
> >> > GCC arg list.
> >>
> >> It still allows to get the ASM part covered. If that's worth it I can't
> >> tell.
> >
> > If there's a makefile error above, then CONFIG_RETPOLINE would already
> > imply compiler support, so the ASM code with the new '%V' option could
> > just do 'ifdef CONFIG_RETPOLINE'.
>
> I did look at ditching the -DRETPOLINE but there is benefit in doing the
> sys_call_table jump even when GCC isn't updated. So I put it back.
What benefit is that? Doesn't it give the user a false sense of
security, since there's no shortage of other indirect branches to
attack?
--
Josh
next prev parent reply other threads:[~2018-01-08 21:20 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-07 22:11 [PATCH v6 00/10] Retpoline: Avoid speculative indirect calls in kernel David Woodhouse
2018-01-07 22:11 ` [PATCH v6 01/10] x86/retpoline: Add initial retpoline support David Woodhouse
2018-01-08 10:45 ` Peter Zijlstra
2018-01-08 10:53 ` David Woodhouse
2018-01-08 11:03 ` Peter Zijlstra
2018-01-08 12:45 ` David Woodhouse
2018-01-08 13:42 ` Josh Poimboeuf
2018-01-08 13:46 ` Thomas Gleixner
2018-01-08 13:53 ` Josh Poimboeuf
2018-01-08 14:26 ` David Woodhouse
2018-01-08 21:20 ` Josh Poimboeuf [this message]
2018-01-09 12:36 ` Peter Zijlstra
2018-01-09 13:35 ` Thomas Gleixner
2018-01-09 13:40 ` Woodhouse, David
2018-01-07 22:11 ` [PATCH v6 02/10] x86/retpoline/crypto: Convert crypto assembler indirect jumps David Woodhouse
2018-01-08 13:49 ` Josh Poimboeuf
2018-01-07 22:11 ` [PATCH v6 03/10] x86/retpoline/entry: Convert entry " David Woodhouse
2018-01-07 22:11 ` [PATCH v6 04/10] x86/retpoline/ftrace: Convert ftrace " David Woodhouse
2018-01-07 22:11 ` [PATCH v6 05/10] x86/retpoline/hyperv: Convert " David Woodhouse
2018-01-07 22:11 ` [PATCH v6 06/10] x86/retpoline/xen: Convert Xen hypercall " David Woodhouse
2018-01-07 22:11 ` [PATCH v6 07/10] x86/retpoline/checksum32: Convert assembler " David Woodhouse
2018-01-07 22:11 ` [PATCH v6 08/10] x86/retpoline/irq32: " David Woodhouse
2018-01-07 22:11 ` [PATCH v6 09/10] x86/retpoline: Add boot time option to disable retpoline David Woodhouse
2018-01-07 22:11 ` [PATCH v6 10/10] x86/retpoline: Exclude objtool with retpoline David Woodhouse
2018-01-08 10:25 ` Thomas Gleixner
2018-01-08 10:34 ` Woodhouse, David
2018-01-08 13:20 ` Josh Poimboeuf
2018-01-07 22:22 ` [PATCH v6 00/10] Retpoline: Avoid speculative indirect calls in kernel Linus Torvalds
2018-01-08 10:01 ` Thomas Gleixner
2018-01-08 17:54 ` Ingo Molnar
2018-01-08 21:10 ` Thomas Gleixner
2018-01-08 10:34 ` Paul Turner
2018-01-08 10:38 ` Jiri Kosina
2018-01-08 10:45 ` Paul Turner
2018-01-08 10:42 ` Paul Turner
2018-01-08 11:16 ` Andrew Cooper
2018-01-08 11:25 ` Paul Turner
2018-01-08 16:13 ` Alexei Starovoitov
2018-01-10 15:20 ` Woodhouse, David
2018-01-10 15:31 ` Dr. David Alan Gilbert
2018-01-08 10:45 ` David Woodhouse
2018-01-08 10:53 ` Paul Turner
2018-01-08 12:49 ` David Woodhouse
2018-01-08 23:44 ` [PATCH v6 11/10] x86/retpoline: Avoid return buffer underflows on context switch David Woodhouse
2018-01-08 23:56 ` Linus Torvalds
2018-01-08 23:58 ` Woodhouse, David
2018-01-09 0:35 ` Linus Torvalds
2018-01-09 0:42 ` David Woodhouse
2018-01-09 0:48 ` Linus Torvalds
2018-01-09 0:55 ` David Woodhouse
2018-01-09 0:44 ` Andi Kleen
2018-01-09 0:58 ` Linus Torvalds
2018-01-09 1:15 ` Andrew Cooper
2018-01-09 3:27 ` Andy Lutomirski
2018-01-09 13:04 ` David Woodhouse
2018-01-09 13:10 ` Peter Zijlstra
2018-01-09 17:53 ` Kees Cook
2018-01-09 18:09 ` Linus Torvalds
2018-02-16 8:58 ` Pavel Machek
2018-01-09 1:16 ` Andi Kleen
2018-01-09 1:21 ` [PATCH v6 11/10] x86/retpoline: Avoid return buffer underflows on context switch II Andi Kleen
2018-01-09 1:23 ` Woodhouse, David
2018-01-09 1:49 ` Andi Kleen
2018-01-09 1:53 ` Paul Turner
2018-01-09 1:18 ` [PATCH v6 11/10] x86/retpoline: Avoid return buffer underflows on context switch Woodhouse, David
2018-01-09 0:06 ` Andi Kleen
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=20180108212046.3wkqerxkellnqudy@treble \
--to=jpoimboe@redhat.com \
--cc=ak@linux.intel.com \
--cc=dave.hansen@intel.com \
--cc=dwmw2@infradead.org \
--cc=dwmw@amazon.co.uk \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=gregkh@linux-foundation.org \
--cc=jikos@kernel.org \
--cc=keescook@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=peterz@infradead.org \
--cc=pjt@google.com \
--cc=riel@redhat.com \
--cc=tglx@linutronix.de \
--cc=tim.c.chen@linux.intel.com \
--cc=torvalds@linux-foundation.org \
/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