diff options
| author | jsing <> | 2026-05-12 15:07:30 +0000 |
|---|---|---|
| committer | jsing <> | 2026-05-12 15:07:30 +0000 |
| commit | 6cbcbbbfb32b8105bcecc2b6440956e972004d10 (patch) | |
| tree | 7fa15ddb0e3646a86c606be850e219145886e1de /src/lib | |
| parent | fa699f744f690ecb17f06bdd1745c5cbaad43976 (diff) | |
| download | openbsd-6cbcbbbfb32b8105bcecc2b6440956e972004d10.tar.gz openbsd-6cbcbbbfb32b8105bcecc2b6440956e972004d10.tar.bz2 openbsd-6cbcbbbfb32b8105bcecc2b6440956e972004d10.zip | |
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@
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/libcrypto/md5/md5_amd64_generic.S | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/sha/sha1_aarch64_ce.S | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/sha/sha1_amd64_generic.S | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/sha/sha1_amd64_shani.S | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/sha/sha256_aarch64_ce.S | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/sha/sha256_amd64_generic.S | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/sha/sha256_amd64_shani.S | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/sha/sha512_aarch64_ce.S | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/sha/sha512_amd64_generic.S | 6 |
9 files changed, 45 insertions, 9 deletions
diff --git a/src/lib/libcrypto/md5/md5_amd64_generic.S b/src/lib/libcrypto/md5/md5_amd64_generic.S index 35e6fcdada..02f6ebdbcc 100644 --- a/src/lib/libcrypto/md5/md5_amd64_generic.S +++ b/src/lib/libcrypto/md5/md5_amd64_generic.S | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: md5_amd64_generic.S,v 1.2 2026/03/28 13:11:28 jsing Exp $ */ | 1 | /* $OpenBSD: md5_amd64_generic.S,v 1.3 2026/05/12 15:07:30 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2025 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2025 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -231,3 +231,7 @@ md5_block_data_order: | |||
| 231 | popq %rbx | 231 | popq %rbx |
| 232 | 232 | ||
| 233 | ret | 233 | ret |
| 234 | |||
| 235 | #if defined(__linux__) && defined(__ELF__) | ||
| 236 | .section .note.GNU-stack,"",%progbits | ||
| 237 | #endif | ||
diff --git a/src/lib/libcrypto/sha/sha1_aarch64_ce.S b/src/lib/libcrypto/sha/sha1_aarch64_ce.S index 9f786960c2..913a7b8fc1 100644 --- a/src/lib/libcrypto/sha/sha1_aarch64_ce.S +++ b/src/lib/libcrypto/sha/sha1_aarch64_ce.S | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: sha1_aarch64_ce.S,v 1.9 2026/05/09 07:02:29 jsing Exp $ */ | 1 | /* $OpenBSD: sha1_aarch64_ce.S,v 1.10 2026/05/12 15:07:30 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2023,2025 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2023,2025 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -215,3 +215,7 @@ CRYPTO_ASSEMBLY_GLOBAL_FUNCTION(sha1_block_ce): | |||
| 215 | str hc1s, [ctx, #(4*4)] | 215 | str hc1s, [ctx, #(4*4)] |
| 216 | 216 | ||
| 217 | ret | 217 | ret |
| 218 | |||
| 219 | #if defined(__linux__) && defined(__ELF__) | ||
| 220 | .section .note.GNU-stack,"",%progbits | ||
| 221 | #endif | ||
diff --git a/src/lib/libcrypto/sha/sha1_amd64_generic.S b/src/lib/libcrypto/sha/sha1_amd64_generic.S index a0473bdd00..c890d0d7fe 100644 --- a/src/lib/libcrypto/sha/sha1_amd64_generic.S +++ b/src/lib/libcrypto/sha/sha1_amd64_generic.S | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: sha1_amd64_generic.S,v 1.7 2026/05/07 15:50:47 jsing Exp $ */ | 1 | /* $OpenBSD: sha1_amd64_generic.S,v 1.8 2026/05/12 15:07:30 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -308,3 +308,7 @@ CRYPTO_ASSEMBLY_GLOBAL_FUNCTION(sha1_block_generic): | |||
| 308 | popq %rbx | 308 | popq %rbx |
| 309 | 309 | ||
| 310 | ret | 310 | ret |
| 311 | |||
| 312 | #if defined(__linux__) && defined(__ELF__) | ||
| 313 | .section .note.GNU-stack,"",%progbits | ||
| 314 | #endif | ||
diff --git a/src/lib/libcrypto/sha/sha1_amd64_shani.S b/src/lib/libcrypto/sha/sha1_amd64_shani.S index c397fa41c9..afba0b9f14 100644 --- a/src/lib/libcrypto/sha/sha1_amd64_shani.S +++ b/src/lib/libcrypto/sha/sha1_amd64_shani.S | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: sha1_amd64_shani.S,v 1.8 2026/05/09 07:02:29 jsing Exp $ */ | 1 | /* $OpenBSD: sha1_amd64_shani.S,v 1.9 2026/05/12 15:07:30 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -163,3 +163,7 @@ CRYPTO_ASSEMBLY_GLOBAL_FUNCTION(sha1_block_shani): | |||
| 163 | CRYPTO_ASSEMBLY_OBJECT_START(shufmask): | 163 | CRYPTO_ASSEMBLY_OBJECT_START(shufmask): |
| 164 | .octa 0x000102030405060708090a0b0c0d0e0f | 164 | .octa 0x000102030405060708090a0b0c0d0e0f |
| 165 | CRYPTO_ASSEMBLY_OBJECT_END(shufmask) | 165 | CRYPTO_ASSEMBLY_OBJECT_END(shufmask) |
| 166 | |||
| 167 | #if defined(__linux__) && defined(__ELF__) | ||
| 168 | .section .note.GNU-stack,"",%progbits | ||
| 169 | #endif | ||
diff --git a/src/lib/libcrypto/sha/sha256_aarch64_ce.S b/src/lib/libcrypto/sha/sha256_aarch64_ce.S index 991f1316c0..75352b4f7a 100644 --- a/src/lib/libcrypto/sha/sha256_aarch64_ce.S +++ b/src/lib/libcrypto/sha/sha256_aarch64_ce.S | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: sha256_aarch64_ce.S,v 1.10 2026/05/07 15:50:47 jsing Exp $ */ | 1 | /* $OpenBSD: sha256_aarch64_ce.S,v 1.11 2026/05/12 15:07:30 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2023,2025 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2023,2025 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -196,3 +196,7 @@ CRYPTO_ASSEMBLY_OBJECT_START(K256): | |||
| 196 | .long 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208 | 196 | .long 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208 |
| 197 | .long 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 | 197 | .long 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 |
| 198 | CRYPTO_ASSEMBLY_OBJECT_END(K256) | 198 | CRYPTO_ASSEMBLY_OBJECT_END(K256) |
| 199 | |||
| 200 | #if defined(__linux__) && defined(__ELF__) | ||
| 201 | .section .note.GNU-stack,"",%progbits | ||
| 202 | #endif | ||
diff --git a/src/lib/libcrypto/sha/sha256_amd64_generic.S b/src/lib/libcrypto/sha/sha256_amd64_generic.S index 0d0e2b75d2..0d18e95d04 100644 --- a/src/lib/libcrypto/sha/sha256_amd64_generic.S +++ b/src/lib/libcrypto/sha/sha256_amd64_generic.S | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: sha256_amd64_generic.S,v 1.9 2026/05/07 15:50:47 jsing Exp $ */ | 1 | /* $OpenBSD: sha256_amd64_generic.S,v 1.10 2026/05/12 15:07:30 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -296,3 +296,7 @@ CRYPTO_ASSEMBLY_OBJECT_START(K256): | |||
| 296 | .long 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208 | 296 | .long 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208 |
| 297 | .long 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 | 297 | .long 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 |
| 298 | CRYPTO_ASSEMBLY_OBJECT_END(K256) | 298 | CRYPTO_ASSEMBLY_OBJECT_END(K256) |
| 299 | |||
| 300 | #if defined(__linux__) && defined(__ELF__) | ||
| 301 | .section .note.GNU-stack,"",%progbits | ||
| 302 | #endif | ||
diff --git a/src/lib/libcrypto/sha/sha256_amd64_shani.S b/src/lib/libcrypto/sha/sha256_amd64_shani.S index 91f22e44d6..e51a168062 100644 --- a/src/lib/libcrypto/sha/sha256_amd64_shani.S +++ b/src/lib/libcrypto/sha/sha256_amd64_shani.S | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: sha256_amd64_shani.S,v 1.7 2026/05/07 15:50:47 jsing Exp $ */ | 1 | /* $OpenBSD: sha256_amd64_shani.S,v 1.8 2026/05/12 15:07:30 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -201,3 +201,7 @@ CRYPTO_ASSEMBLY_OBJECT_START(K256): | |||
| 201 | .long 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208 | 201 | .long 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208 |
| 202 | .long 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 | 202 | .long 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 |
| 203 | CRYPTO_ASSEMBLY_OBJECT_END(K256) | 203 | CRYPTO_ASSEMBLY_OBJECT_END(K256) |
| 204 | |||
| 205 | #if defined(__linux__) && defined(__ELF__) | ||
| 206 | .section .note.GNU-stack,"",%progbits | ||
| 207 | #endif | ||
diff --git a/src/lib/libcrypto/sha/sha512_aarch64_ce.S b/src/lib/libcrypto/sha/sha512_aarch64_ce.S index 77bd44593d..8c88696e4a 100644 --- a/src/lib/libcrypto/sha/sha512_aarch64_ce.S +++ b/src/lib/libcrypto/sha/sha512_aarch64_ce.S | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: sha512_aarch64_ce.S,v 1.8 2026/05/07 15:50:47 jsing Exp $ */ | 1 | /* $OpenBSD: sha512_aarch64_ce.S,v 1.9 2026/05/12 15:07:30 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2023,2025 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2023,2025 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -322,3 +322,7 @@ CRYPTO_ASSEMBLY_OBJECT_START(K512): | |||
| 322 | .quad 0x28db77f523047d84, 0x32caab7b40c72493, 0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c | 322 | .quad 0x28db77f523047d84, 0x32caab7b40c72493, 0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c |
| 323 | .quad 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a, 0x5fcb6fab3ad6faec, 0x6c44198c4a475817 | 323 | .quad 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a, 0x5fcb6fab3ad6faec, 0x6c44198c4a475817 |
| 324 | CRYPTO_ASSEMBLY_OBJECT_END(K512) | 324 | CRYPTO_ASSEMBLY_OBJECT_END(K512) |
| 325 | |||
| 326 | #if defined(__linux__) && defined(__ELF__) | ||
| 327 | .section .note.GNU-stack,"",%progbits | ||
| 328 | #endif | ||
diff --git a/src/lib/libcrypto/sha/sha512_amd64_generic.S b/src/lib/libcrypto/sha/sha512_amd64_generic.S index 61028c0a0b..2e862df5ef 100644 --- a/src/lib/libcrypto/sha/sha512_amd64_generic.S +++ b/src/lib/libcrypto/sha/sha512_amd64_generic.S | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: sha512_amd64_generic.S,v 1.7 2026/05/07 15:50:47 jsing Exp $ */ | 1 | /* $OpenBSD: sha512_amd64_generic.S,v 1.8 2026/05/12 15:07:30 jsing Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -301,3 +301,7 @@ CRYPTO_ASSEMBLY_OBJECT_START(K512): | |||
| 301 | .quad 0x28db77f523047d84, 0x32caab7b40c72493, 0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c | 301 | .quad 0x28db77f523047d84, 0x32caab7b40c72493, 0x3c9ebe0a15c9bebc, 0x431d67c49c100d4c |
| 302 | .quad 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a, 0x5fcb6fab3ad6faec, 0x6c44198c4a475817 | 302 | .quad 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a, 0x5fcb6fab3ad6faec, 0x6c44198c4a475817 |
| 303 | CRYPTO_ASSEMBLY_OBJECT_END(K512) | 303 | CRYPTO_ASSEMBLY_OBJECT_END(K512) |
| 304 | |||
| 305 | #if defined(__linux__) && defined(__ELF__) | ||
| 306 | .section .note.GNU-stack,"",%progbits | ||
| 307 | #endif | ||
