All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Gerst <brgerst@gmail.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	X86 ML <x86@kernel.org>, Steven Rostedt <rostedt@goodmis.org>,
	Andi Kleen <andi@firstfloor.org>
Subject: Re: Why is irq_stack_union a union?
Date: Mon, 31 Aug 2015 17:47:46 -0400	[thread overview]
Message-ID: <CAMzpN2iUWaQrYBXrSHM+BuoOKZ3Kc1=ErNEw02tV0K6KUWZLhg@mail.gmail.com> (raw)
In-Reply-To: <CALCETrUUSyfZzQUOya9fLOewehOzm-vkLpPhMriJquFLvSzw6Q@mail.gmail.com>

On Mon, Aug 31, 2015 at 5:00 PM, Andy Lutomirski <luto@amacapital.net> wrote:
> Why not just a struct? Also, why is this all tangled up in gsbase initialization?

It has to do with the fact that the GCC stackprotector is hardcoded to
look for the canary at %gs:40.  Since we also use %gs for the percpu
segment, we have to make sure that the canary is placed at the start
of the percpu section.  Overlaying it onto the bottom of the IRQ stack
and was the most convenient way to do it, with a side benefit that
overflowing the stack will trip the canary.

--
Brian Gerst

  reply	other threads:[~2015-08-31 21:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-31 21:00 Why is irq_stack_union a union? Andy Lutomirski
2015-08-31 21:47 ` Brian Gerst [this message]
2015-08-31 22:01   ` Andy Lutomirski
2015-09-01  3:55     ` Brian Gerst
2015-09-01 21:42       ` Andy Lutomirski

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='CAMzpN2iUWaQrYBXrSHM+BuoOKZ3Kc1=ErNEw02tV0K6KUWZLhg@mail.gmail.com' \
    --to=brgerst@gmail.com \
    --cc=andi@firstfloor.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    --cc=rostedt@goodmis.org \
    --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.