aboutsummaryrefslogtreecommitdiff
path: root/patches/gnu-stack.patch
blob: ed0bbee8e22d81937e4982e69b2676619e551424 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Backport from 7.9-current (omitting md5):

commit 6cbcbbbfb32b8105bcecc2b6440956e972004d10
Author: jsing <>
Date:   Tue May 12 15:07:30 2026 +0000

    Add a guarded .note.GNU-stack section to crypto assembly files.
    
    Add a .note.GNU-stack section to avoid ending up with an executable stack
    on toolchains that believe we should have an executable stack by default.
    
    Reported by ruuda on Github.
    
    Discussed with tb@

--- crypto/sha/sha1_aarch64_ce.S.orig	Tue May 12 10:35:15 2026
+++ crypto/sha/sha1_aarch64_ce.S	Tue May 12 10:35:23 2026
@@ -213,3 +213,7 @@
 	str	hc1s, [ctx, #(4*4)]
 
 	ret
+
+#if defined(__linux__) && defined(__ELF__)
+.section .note.GNU-stack,"",%progbits
+#endif
--- crypto/sha/sha1_amd64_generic.S.orig	Tue May 12 10:35:15 2026
+++ crypto/sha/sha1_amd64_generic.S	Tue May 12 10:35:23 2026
@@ -308,3 +308,7 @@
 	popq	%rbx
 
 	ret
+
+#if defined(__linux__) && defined(__ELF__)
+.section .note.GNU-stack,"",%progbits
+#endif
--- crypto/sha/sha1_amd64_shani.S.orig	Tue May 12 10:35:15 2026
+++ crypto/sha/sha1_amd64_shani.S	Tue May 12 10:35:23 2026
@@ -164,3 +164,7 @@
 shufmask:
 .octa	0x000102030405060708090a0b0c0d0e0f
 .size	shufmask,.-shufmask
+
+#if defined(__linux__) && defined(__ELF__)
+.section .note.GNU-stack,"",%progbits
+#endif
--- crypto/sha/sha256_aarch64_ce.S.orig	Tue May 12 10:35:15 2026
+++ crypto/sha/sha256_aarch64_ce.S	Tue May 12 10:35:23 2026
@@ -195,3 +195,7 @@
 .long	0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208
 .long	0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
 .size	K256,.-K256
+
+#if defined(__linux__) && defined(__ELF__)
+.section .note.GNU-stack,"",%progbits
+#endif
--- crypto/sha/sha256_amd64_generic.S.orig	Tue May 12 10:35:15 2026
+++ crypto/sha/sha256_amd64_generic.S	Tue May 12 10:35:23 2026
@@ -297,3 +297,7 @@
 .long	0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208
 .long	0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
 .size	K256,.-K256
+
+#if defined(__linux__) && defined(__ELF__)
+.section .note.GNU-stack,"",%progbits
+#endif
--- crypto/sha/sha256_amd64_shani.S.orig	Tue May 12 10:35:15 2026
+++ crypto/sha/sha256_amd64_shani.S	Tue May 12 10:35:23 2026
@@ -203,3 +203,7 @@
 .long	0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208
 .long	0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
 .size	K256,.-K256
+
+#if defined(__linux__) && defined(__ELF__)
+.section .note.GNU-stack,"",%progbits
+#endif
--- crypto/sha/sha512_aarch64_ce.S.orig	Tue May 12 10:35:15 2026
+++ crypto/sha/sha512_aarch64_ce.S	Tue May 12 10:35:23 2026
@@ -320,3 +320,7 @@
 .quad	0x28db77f523047d84, 0x32caab7b40c72493, 0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c
 .quad	0x4cc5d4becb3e42b6, 0x597f299cfc657e2a, 0x5fcb6fab3ad6faec, 0x6c44198c4a475817
 .size	K512,.-K512
+
+#if defined(__linux__) && defined(__ELF__)
+.section .note.GNU-stack,"",%progbits
+#endif
--- crypto/sha/sha512_amd64_generic.S.orig	Tue May 12 10:35:15 2026
+++ crypto/sha/sha512_amd64_generic.S	Tue May 12 10:35:23 2026
@@ -302,3 +302,7 @@
 .quad	0x28db77f523047d84, 0x32caab7b40c72493, 0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c
 .quad	0x4cc5d4becb3e42b6, 0x597f299cfc657e2a, 0x5fcb6fab3ad6faec, 0x6c44198c4a475817
 .size	K512,.-K512
+
+#if defined(__linux__) && defined(__ELF__)
+.section .note.GNU-stack,"",%progbits
+#endif