All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	Will Deacon <will@kernel.org>, Arnd Bergmann <arnd@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Theodore Ts'o <tytso@mit.edu>,
	"Cc: Android Kernel" <kernel-team@android.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Florian Weimer <fweimer@redhat.com>
Subject: Re: [PATCH] compiler.h: Raise minimum version of GCC to 5.1 for arm64
Date: Wed, 13 Jan 2021 21:44:37 +0000	[thread overview]
Message-ID: <20210113214436.GL1551@shell.armlinux.org.uk> (raw)
In-Reply-To: <CAHk-=wiQ_tp8NmKV8PJ-6WMo3dTEZwDo3a0hYjcUFqMdviNTYw@mail.gmail.com>

On Wed, Jan 13, 2021 at 11:15:09AM -0800, Linus Torvalds wrote:
> On Wed, Jan 13, 2021 at 9:58 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > Maybe, we can raise the minimal version to gcc 5.1
> > for all architectures.
> 
> It was discussed, but the immediate reason for this thing really does
> seem to be specific to just arm64 (ie this is not some generic gcc
> stack access bug that just happens to rear its head on arm64 - the
> patch to fix this in the gcc bugzilla is very much arm64-only).

I seem to remember during the discussion of the arm64 problem, that
there was a similar bug on e.g. sparc, but they patched the kernel.
*digs through irc logs...*

https://patchwork.kernel.org/project/linux-crypto/patch/20170602.112854.571030442583332811.davem@davemloft.net/
https://marc.info/?l=linux-sparc&m=149636946609980&w=2

(and they even reference the arm64 bug). If you move on two messages,
then the disassembly clearly shows that it is the same bug on Sparc.

DaveM came up with the following to fix it:

commit d41519a69b35b10af7fda867fb9100df24fdf403
Author: David Miller <davem@davemloft.net>
Date:   Fri Jun 2 11:28:54 2017 -0400

    crypto: Work around deallocated stack frame reference gcc bug on sparc.

which added a bunch of barriers across the kernel to cater for this,
but for them, ext4 was not impacted at that time.

Apparently, davem's justification for not changing ext4 was:

"Actually, ext4 doesn't trigger the problem because the on-stack object
used in ext4 is a fixed size at compile time"

So, maybe the Sparc issue was just a similar but different bug in gcc
4.9.x.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

WARNING: multiple messages have this Message-ID (diff)
From: Russell King - ARM Linux admin <linux@armlinux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Florian Weimer <fweimer@redhat.com>,
	Arnd Bergmann <arnd@kernel.org>,
	"Cc: Android Kernel" <kernel-team@android.com>,
	Theodore Ts'o <tytso@mit.edu>,
	Peter Zijlstra <peterz@infradead.org>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Masahiro Yamada <masahiroy@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Will Deacon <will@kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] compiler.h: Raise minimum version of GCC to 5.1 for arm64
Date: Wed, 13 Jan 2021 21:44:37 +0000	[thread overview]
Message-ID: <20210113214436.GL1551@shell.armlinux.org.uk> (raw)
In-Reply-To: <CAHk-=wiQ_tp8NmKV8PJ-6WMo3dTEZwDo3a0hYjcUFqMdviNTYw@mail.gmail.com>

On Wed, Jan 13, 2021 at 11:15:09AM -0800, Linus Torvalds wrote:
> On Wed, Jan 13, 2021 at 9:58 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > Maybe, we can raise the minimal version to gcc 5.1
> > for all architectures.
> 
> It was discussed, but the immediate reason for this thing really does
> seem to be specific to just arm64 (ie this is not some generic gcc
> stack access bug that just happens to rear its head on arm64 - the
> patch to fix this in the gcc bugzilla is very much arm64-only).

I seem to remember during the discussion of the arm64 problem, that
there was a similar bug on e.g. sparc, but they patched the kernel.
*digs through irc logs...*

https://patchwork.kernel.org/project/linux-crypto/patch/20170602.112854.571030442583332811.davem@davemloft.net/
https://marc.info/?l=linux-sparc&m=149636946609980&w=2

(and they even reference the arm64 bug). If you move on two messages,
then the disassembly clearly shows that it is the same bug on Sparc.

DaveM came up with the following to fix it:

commit d41519a69b35b10af7fda867fb9100df24fdf403
Author: David Miller <davem@davemloft.net>
Date:   Fri Jun 2 11:28:54 2017 -0400

    crypto: Work around deallocated stack frame reference gcc bug on sparc.

which added a bunch of barriers across the kernel to cater for this,
but for them, ext4 was not impacted at that time.

Apparently, davem's justification for not changing ext4 was:

"Actually, ext4 doesn't trigger the problem because the on-stack object
used in ext4 is a fixed size at compile time"

So, maybe the Sparc issue was just a similar but different bug in gcc
4.9.x.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-01-14  2:13 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-12 22:48 [PATCH] compiler.h: Raise minimum version of GCC to 5.1 for arm64 Will Deacon
2021-01-12 22:48 ` Will Deacon
2021-01-12 22:57 ` Nick Desaulniers
2021-01-12 22:57   ` Nick Desaulniers
2021-01-12 23:06 ` Nathan Chancellor
2021-01-12 23:06   ` Nathan Chancellor
2021-01-13  2:14 ` Linus Torvalds
2021-01-13  2:14   ` Linus Torvalds
2021-01-13  2:35   ` Linus Torvalds
2021-01-13  2:35     ` Linus Torvalds
2021-01-13 15:02     ` Catalin Marinas
2021-01-13 15:02       ` Catalin Marinas
2021-01-13 16:07 ` Catalin Marinas
2021-01-13 16:07   ` Catalin Marinas
2021-01-13 17:57   ` Masahiro Yamada
2021-01-13 17:57     ` Masahiro Yamada
2021-01-13 18:33     ` Joe Perches
2021-01-13 18:33       ` Joe Perches
2021-01-13 19:15     ` Linus Torvalds
2021-01-13 19:15       ` Linus Torvalds
2021-01-13 21:44       ` Russell King - ARM Linux admin [this message]
2021-01-13 21:44         ` Russell King - ARM Linux admin
2021-01-13 22:08         ` Linus Torvalds
2021-01-13 22:08           ` Linus Torvalds
2021-01-14  8:18           ` Ard Biesheuvel
2021-01-14  8:18             ` Ard Biesheuvel
2021-01-14 18:43             ` Linus Torvalds
2021-01-14 18:43               ` Linus Torvalds
2021-01-14 19:51               ` Joe Perches
2021-01-14 19:51                 ` Joe Perches
2021-01-14 21:18                 ` Linus Torvalds
2021-01-14 21:18                   ` Linus Torvalds
2021-01-15  0:30                   ` Joe Perches
2021-01-15  0:30                     ` Joe Perches
2021-01-15 23:24                     ` Linus Torvalds
2021-01-15 23:24                       ` Linus Torvalds
2021-02-27  7:16               ` Masahiro Yamada
2021-02-27  7:16                 ` 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=20210113214436.GL1551@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=arnd@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=fweimer@redhat.com \
    --cc=kernel-team@android.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=peterz@infradead.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    --cc=will@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.