All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: David Laight <David.Laight@ACULAB.COM>
Cc: 'Brian Gerst' <brgerst@gmail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"x86@kernel.org" <x86@kernel.org>,
	Andy Lutomirski <luto@kernel.org>, Borislav Petkov <bp@alien8.de>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H . Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH v2 2/6] x86-64: Convert stack protector to normal percpu variable
Date: Thu, 2 Dec 2021 23:51:07 +0100	[thread overview]
Message-ID: <20211202225107.GF16608@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <2c23335e98bc4a66b1fd779a78ddd821@AcuMS.aculab.com>

On Wed, Dec 01, 2021 at 09:50:57AM +0000, David Laight wrote:
> From: Brian Gerst
> > Sent: 30 November 2021 20:56
> > 
> > Older versions of GCC fixed the location of the stack protector canary
> > at %gs:40.  This constraint forced the percpu section to be linked at
> > virtual address 0 so that the canary could be the first data object in
> > the percpu section.  Supporting the zero-based percpu section requires
> > additional code to handle relocations for RIP-relative references to
> > percpu data, extra complexity to kallsyms, and workarounds for linker
> > bugs due to the use of absolute symbols.
> > 
> > Since version 8.1, GCC has options to configure the location of the
> > canary value.  This allows the canary to be turned into a normal
> > percpu variable and removes the constraint that the percpu section
> > be zero-based.
> 
> I didn't think the minimum gcc version has been raised as far as 8.1?

Older GCC can still build a kernel, just not with stack protector on.
And 8.1 is already 3 years old. If you run ancient distros, you can run
ancient kernels too.

  parent reply	other threads:[~2021-12-02 22:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30 20:55 [PATCH v2 0/6] x86-64: Stack protector and percpu improvements Brian Gerst
2021-11-30 20:55 ` [PATCH v2 1/6] x86: Remove stack protector test scripts Brian Gerst
2021-11-30 20:55 ` [PATCH v2 2/6] x86-64: Convert stack protector to normal percpu variable Brian Gerst
2021-12-01  9:50   ` David Laight
2021-12-01 14:21     ` Brian Gerst
2021-12-02 22:51     ` Peter Zijlstra [this message]
2021-11-30 20:55 ` [PATCH v2 3/6] x86-64: Use relative per-cpu offsets Brian Gerst
2021-11-30 20:55 ` [PATCH v2 4/6] x86-64: Remove inverse relocations Brian Gerst
2021-11-30 20:55 ` [PATCH v2 5/6] kallsyms: Remove KALLSYMS_ABSOLUTE_PERCPU Brian Gerst
2021-11-30 20:55 ` [PATCH v2 6/6] percpu: Remove PER_CPU_FIRST_SECTION Brian Gerst

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=20211202225107.GF16608@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=David.Laight@ACULAB.COM \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@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.