aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Radev <martin.b.radev@gmail.com>2022-05-09 23:39:40 +0300
committerWill Deacon <will@kernel.org>2022-05-20 21:36:32 +0100
commita68a52cd8ab76483b3592ddc0f7dbf40b4bd55ba (patch)
treef9a712aa969ca0c40b33809b6af80e69883da50e
parent31e0eacca520f60ac02dfaaaeaeddfcc132095c0 (diff)
downloadkvmtool-a68a52cd8ab76483b3592ddc0f7dbf40b4bd55ba.tar.gz
kvmtool: Have stack be not executable on x86
This patch fixes an issue of having the stack be executable for x86 builds by ensuring that the two objects bios-rom.o and entry.o have the section .note.GNU-stack. Suggested-by: Alexandru Elisei <alexandru.elisei@arm.com> Signed-off-by: Martin Radev <martin.b.radev@gmail.com> Link: https://lore.kernel.org/r/20220509203940.754644-7-martin.b.radev@gmail.com Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r--x86/bios/bios-rom.S5
-rw-r--r--x86/bios/entry.S5
2 files changed, 10 insertions, 0 deletions
diff --git a/x86/bios/bios-rom.S b/x86/bios/bios-rom.S
index 3269ce97..d1c8b25a 100644
--- a/x86/bios/bios-rom.S
+++ b/x86/bios/bios-rom.S
@@ -10,3 +10,8 @@
GLOBAL(bios_rom)
.incbin "x86/bios/bios.bin"
END(bios_rom)
+
+/*
+ * Add this section to ensure final binary has a non-executable stack.
+ */
+.section .note.GNU-stack,"",@progbits
diff --git a/x86/bios/entry.S b/x86/bios/entry.S
index 85056e98..1b71f898 100644
--- a/x86/bios/entry.S
+++ b/x86/bios/entry.S
@@ -90,3 +90,8 @@ GLOBAL(__locals)
#include "local.S"
END(__locals)
+
+/*
+ * Add this section to ensure final binary has a non-executable stack.
+ */
+.section .note.GNU-stack,"",@progbits