nodejs22/0003-src-add-.note.GNU-stack-section.patch
Stephen Gallagher 32edd143c2
Disable stack execution
Resolves: rhbz#1950528

Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
2021-04-20 09:41:38 -04:00

46 lines
1.4 KiB
Diff

From 6aa11a8cf48463432c0b5c6bfca5c2a5b18b1cc7 Mon Sep 17 00:00:00 2001
From: James Addison <jay@jp-hosting.net>
Date: Tue, 9 Mar 2021 13:08:47 +0000
Subject: [PATCH 3/3] src: add .note.GNU-stack section
This indicates to GNU binutils that it can unset the executable stack
flag on the binary that it is building.
PR-URL: https://github.com/nodejs/node/pull/37688
Refs: https://github.com/nodejs/node/issues/17933
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
src: Use %progbits instead of @progbits
While @progbits is preferred for most architectures, there are some
(notably 32-bit ARM) for which it does not. %progbits is effective
everywhere.
See https://bugzilla.redhat.com/show_bug.cgi?id=1950528 for more
details.
Related: https://github.com/nodejs/node/issues/17933
Related: https://github.com/nodejs/node/pull/37688
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
---
src/large_pages/node_text_start.S | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/large_pages/node_text_start.S b/src/large_pages/node_text_start.S
index 1609b254f0495a32f8896ba96d96bad03f6f2321..d27dd39cc236f0e6be4e68113bfff7b531a37455 100644
--- a/src/large_pages/node_text_start.S
+++ b/src/large_pages/node_text_start.S
@@ -1,5 +1,8 @@
+#if defined(__ELF__)
+.section .note.GNU-stack,"",%progbits
+#endif
.text
.align 0x2000
.global __node_text_start
.hidden __node_text_start
__node_text_start:
--
2.31.1