Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Dufour <ldufour@linux.vnet.ibm.com>
To: Mike Frysinger <vapier@gentoo.org>, kexec@lists.infradead.org
Cc: Mike Frysinger <vapier@chromium.org>
Subject: Re: [PATCH] purgatory: force PIC/PIE/SSP off
Date: Thu, 16 Apr 2015 09:30:15 +0200	[thread overview]
Message-ID: <552F6507.1010500@linux.vnet.ibm.com> (raw)
In-Reply-To: <1429161304-2772-1-git-send-email-vapier@gentoo.org>

On 16/04/2015 07:15, Mike Frysinger wrote:
> From: Mike Frysinger <vapier@chromium.org>
> 
> If the toolchain has these things turned on automatically, then the
> purgatory code might be miscompiled leading to runtime errors like:
> Unhandled rela relocation: R_X86_64_GOTPC64
> 
> It might look like the problem is with the kernel when in reality,
> kexec is complaining about the purgatory module.  Force off harden
> features that don't make sense in kernel space.
> 
> Signed-off-by: Mike Frysinger <vapier@chromium.org>
> ---
>  purgatory/Makefile | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/purgatory/Makefile b/purgatory/Makefile
> index 2d6b2c0..2b5c061 100644
> --- a/purgatory/Makefile
> +++ b/purgatory/Makefile
> @@ -49,7 +49,8 @@ $(PURGATORY): CC=$(TARGET_CC)
>  $(PURGATORY): CFLAGS+=$(PURGATORY_EXTRA_CFLAGS) \
>  		      $($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
>  		      -Os -fno-builtin -ffreestanding \
> -		      -fno-zero-initialized-in-bss
> +		      -fno-zero-initialized-in-bss \
> +		      -fno-PIC -fno-PIE -fno-stack-protector

Some architectures (ppc64 and s390) are already setting
-fno-stack-protector in purgatory/arch/x/Makefile through
x_PURGATORY_EXTRA_CFLAGS.

It would be cleaner to remove those per architecture settings if you set
it globally.

Cheers,
Laurent.


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

  reply	other threads:[~2015-04-16  7:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-16  5:15 [PATCH] purgatory: force PIC/PIE/SSP off Mike Frysinger
2015-04-16  7:30 ` Laurent Dufour [this message]
2015-04-16  7:39   ` [PATCH v2] " Mike Frysinger
2015-04-30  5:05     ` Simon Horman

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=552F6507.1010500@linux.vnet.ibm.com \
    --to=ldufour@linux.vnet.ibm.com \
    --cc=kexec@lists.infradead.org \
    --cc=vapier@chromium.org \
    --cc=vapier@gentoo.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