linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Greg KH <greg@kroah.com>
Cc: Justin Forbes <jforbes@redhat.com>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Michal Marek <michal.lkml@markovi.net>,
	linux-hardening@vger.kernel.org,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Ondrej Mosnacek <omosnace@redhat.com>
Subject: Re: [PATCH RFC] gcc-plugins: Handle GCC version mismatch for OOT modules
Date: Tue, 26 Jan 2021 08:51:55 -0600	[thread overview]
Message-ID: <20210126145155.kcfbnzfqg5qugvcl@treble> (raw)
In-Reply-To: <YBAeYaDReAc9VscA@kroah.com>

On Tue, Jan 26, 2021 at 02:51:29PM +0100, Greg KH wrote:
> On Tue, Jan 26, 2021 at 06:44:44AM -0600, Justin Forbes wrote:
> > On Tue, Jan 26, 2021 at 2:21 AM Greg KH <greg@kroah.com> wrote:
> > >
> > > On Mon, Jan 25, 2021 at 04:07:57PM -0600, Josh Poimboeuf wrote:
> > > > On Tue, Jan 26, 2021 at 06:44:35AM +0900, Masahiro Yamada wrote:
> > > > > > > If people use a different compiler, they must be
> > > > > > > prepared for any possible problem.
> > > > > > >
> > > > > > > Using different compiler flags for in-tree and out-of-tree
> > > > > > > is even more dangerous.
> > > > > > >
> > > > > > > For example, CONFIG_GCC_PLUGIN_RANDSTRUCT is enabled
> > > > > > > for in-tree build, and then disabled for out-of-tree modules,
> > > > > > > the struct layout will mismatch, won't it?
> > > > > >
> > > > > > If you read the patch you'll notice that it handles that case, when it's
> > > > > > caused by GCC mismatch.
> > > > > >
> > > > > > However, as alluded to in the [1] footnote, it doesn't handle the case
> > > > > > where the OOT build system doesn't have gcc-plugin-devel installed.
> > > > > > Then CONFIG_GCC_PLUGIN_RANDSTRUCT gets silently disabled and the build
> > > > > > succeeds!  That happens even without a GCC mismatch.
> > > > >
> > > > >
> > > > > Ah, sorry.
> > > > >
> > > > > I responded too early before reading the patch fully.
> > > > >
> > > > > But, I do not like to make RANDSTRUCT a special case.
> > > > >
> > > > > I'd rather want to stop building for any plugin.
> > > >
> > > > Other than RANDSTRUCT there doesn't seem to be any problem with
> > > > disabling them (and printing a warning) in the OOT build.  Why not give
> > > > users that option?  It's harmless, and will make distro's (and their
> > > > users') lives easier.
> > > >
> > > > Either GCC mismatch is ok, or it's not.  Let's not half-enforce it.
> > >
> > > As I said earlier, it's not ok, we can not support it at all.
> > >
> > 
> > Support and enforce are 2 completely different things.  To shed a bit
> > more light on this, the real issue that prompted this was breaking CI
> > systems.  As we enabled gcc plugins in Fedora, and the toolchain folks
> > went through 3 different snapshots of gcc 11 in a week. Any CI process
> > that built an out of tree module failed. I don't think this is nearly
> > as much of a concern for stable distros, as it is for CI in
> > development cycles.
> 
> It's better to have an obvious break like this than to silently accept
> things and then have a much harder issue to debug at runtime, right?

User space mixes compiler versions all the time.  The C ABI is stable.

What specifically is the harder issue you're referring to?

-- 
Josh


  reply	other threads:[~2021-01-26 14:54 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-25 20:42 [PATCH RFC] gcc-plugins: Handle GCC version mismatch for OOT modules Josh Poimboeuf
2021-01-25 21:16 ` Masahiro Yamada
2021-01-25 21:27   ` Josh Poimboeuf
2021-01-25 21:44     ` Masahiro Yamada
2021-01-25 22:07       ` Josh Poimboeuf
2021-01-26  8:13         ` Greg KH
2021-01-26 12:44           ` Justin Forbes
2021-01-26 13:51             ` Greg KH
2021-01-26 14:51               ` Josh Poimboeuf [this message]
2021-01-26 15:00                 ` Greg KH
2021-01-26 15:15                 ` Peter Zijlstra
2021-01-26 15:46                   ` Josh Poimboeuf
2021-01-26 16:05                     ` Peter Zijlstra
2021-01-26 16:15                       ` Justin Forbes
2021-01-26 16:19                         ` Josh Poimboeuf
2021-01-26 17:06                           ` Greg KH
2021-01-26 17:47                             ` Justin Forbes
2021-01-26 16:22                       ` David Laight
2021-01-27 18:03             ` Christoph Hellwig
2021-01-26  8:12     ` Greg KH
2021-01-25 22:03 ` Kees Cook
2021-01-25 22:19   ` Josh Poimboeuf
2021-01-26 17:56     ` Kees Cook
2021-01-26 18:43       ` Josh Poimboeuf
2021-01-26 22:59         ` Kees Cook
2021-01-26 23:32           ` Josh Poimboeuf
2021-01-26  1:53   ` Masahiro Yamada
2021-01-26 12:16     ` David Laight
2021-01-27 18:02 ` Christoph Hellwig
2021-01-27 18:38   ` Josh Poimboeuf
2021-01-27 18:43     ` Christoph Hellwig
2021-01-27 18:51       ` Josh Poimboeuf
2021-01-27 22:09         ` David Laight
2021-01-28 14:29         ` Christoph Hellwig
2021-01-28 15:45           ` Josh Poimboeuf
2021-03-02 23:26 ` Josh Poimboeuf
2021-03-03 18:49   ` Masahiro Yamada
2021-03-03 19:15     ` Josh Poimboeuf
2021-03-03 19:25       ` Linus Torvalds
2021-03-03 19:38         ` Josh Poimboeuf
2021-03-03 19:57           ` Linus Torvalds
2021-03-03 20:24             ` Josh Poimboeuf
2021-03-03 20:31               ` Josh Poimboeuf
2021-03-03 20:56               ` Linus Torvalds
2021-03-03 21:45                 ` Josh Poimboeuf
2021-03-04 12:27                   ` Masahiro Yamada
2021-03-04 15:08                     ` Josh Poimboeuf
2021-03-04 15:35                       ` Masahiro Yamada
2021-03-04 19:12                         ` Linus Torvalds
2021-03-05  2:41                           ` Josh Poimboeuf
2021-03-05  2:49                             ` Linus Torvalds
2021-03-05 16:03                             ` Masahiro Yamada
2021-03-05 19:18                               ` Josh Poimboeuf
2021-03-08  9:39                                 ` David Laight
2021-03-05 15:31                           ` Masahiro Yamada
2021-03-03 21:52             ` Kees Cook
2021-03-04 12:26       ` Masahiro Yamada

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=20210126145155.kcfbnzfqg5qugvcl@treble \
    --to=jpoimboe@redhat.com \
    --cc=greg@kroah.com \
    --cc=jforbes@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=omosnace@redhat.com \
    --cc=peterz@infradead.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;
as well as URLs for NNTP newsgroup(s).