Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] purgatory: force PIC/PIE/SSP off
@ 2015-04-16  5:15 Mike Frysinger
  2015-04-16  7:30 ` Laurent Dufour
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2015-04-16  5:15 UTC (permalink / raw)
  To: kexec; +Cc: Mike Frysinger

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
 
 $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
 			-I$(srcdir)/purgatory/include \
-- 
2.3.5


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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-30  5:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-16  5:15 [PATCH] purgatory: force PIC/PIE/SSP off Mike Frysinger
2015-04-16  7:30 ` Laurent Dufour
2015-04-16  7:39   ` [PATCH v2] " Mike Frysinger
2015-04-30  5:05     ` Simon Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox