All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: stable@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, Juergen Gross <jgross@suse.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [4.4 STABLE BACKPORT] x86: paravirt: make native_save_fl extern inline
Date: Sat, 21 Jul 2018 07:08:27 +0200	[thread overview]
Message-ID: <20180721050827.GD27598@kroah.com> (raw)
In-Reply-To: <20180720223642.126080-1-ndesaulniers@google.com>

On Fri, Jul 20, 2018 at 03:36:41PM -0700, Nick Desaulniers wrote:
> native_save_fl() is marked static inline, but by using it as
> a function pointer in arch/x86/kernel/paravirt.c, it MUST be outlined.
> 
> paravirt's use of native_save_fl() also requires that no GPRs other than
> %rax are clobbered.
> 
> Compilers have different heuristics which they use to emit stack guard
> code, the emittance of which can break paravirt's callee saved assumption
> by clobbering %rcx.
> 
> Marking a function definition extern inline means that if this version
> cannot be inlined, then the out-of-line version will be preferred. By
> having the out-of-line version be implemented in assembly, it cannot be
> instrumented with a stack protector, which might violate custom calling
> conventions that code like paravirt rely on.
> 
> The semantics of extern inline has changed since gnu89. This means that
> folks using GCC versions >= 5.1 may see symbol redefinition errors at
> link time for subdirs that override KBUILD_CFLAGS (making the C standard
> used implicit) regardless of this patch. This has been cleaned up
> earlier in the patch set, but is left as a note in the commit message
> for future travelers.
> 
> Reports:
> https://lkml.org/lkml/2018/5/7/534
> https://github.com/ClangBuiltLinux/linux/issues/16
> 
> Discussion:
> https://bugs.llvm.org/show_bug.cgi?id=37512
> https://lkml.org/lkml/2018/5/24/1371
> 
> Thanks to the many folks that participated in the discussion.
> 
> Acked-by: Juergen Gross <jgross@suse.com>
> Debugged-by: Alistair Strachan <astrachan@google.com>
> Debugged-by: Matthias Kaehlcke <mka@chromium.org>
> Reported-by: Sedat Dilek <sedat.dilek@gmail.com>
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
> Suggested-by: Arnd Bergmann <arnd@arndb.de>
> Suggested-by: H. Peter Anvin <hpa@zytor.com>
> Suggested-by: Tom Stellar <tstellar@redhat.com>
> Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
> ---
> Backport for 4.4. 4.4 is missing commit 784d5699eddc "x86: move exports to
> actual definitions" which doesn't apply cleanly, and not really worth
> backporting IMO. It's simpler to change this patch from upstream:
> + #include <asm-generic/export.h>
> rather than
> + #include <asm/export.h>

Yeah, that makes sense, thanks for the backport.  I'll queue it up after
the next round of stable kernels comes out in a few days.

greg k-h

  parent reply	other threads:[~2018-07-21  5:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-17 23:48 request (x86 + stack protector + paravirt + clang) Nick Desaulniers
2018-07-18  8:48 ` Greg KH
2018-07-18  8:53   ` Greg KH
2018-07-18  9:07   ` Greg KH
2018-07-20 22:36     ` [4.4 STABLE BACKPORT] x86: paravirt: make native_save_fl extern inline Nick Desaulniers
2018-07-21  0:04       ` kbuild test robot
2018-07-21  0:06         ` Nick Desaulniers
2018-07-21  5:07           ` Greg KH
2018-07-21  5:08       ` Greg KH [this message]
2018-07-23  7:57       ` Greg KH
2018-07-20 22:45     ` request (x86 + stack protector + paravirt + clang) Nick Desaulniers
2018-07-21  5:07       ` Greg KH

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=20180721050827.GD27598@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=hpa@zytor.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=ndesaulniers@google.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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 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.