]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Remove executable flag from GNU_STACK section 2857/head
authorko-zu <causeless@gmail.com>
Sat, 13 Nov 2021 13:48:33 +0000 (22:48 +0900)
committerko-zu <causeless@gmail.com>
Sat, 13 Nov 2021 13:58:33 +0000 (22:58 +0900)
Putting stack marking into every assembly files is required to indicate
that the stack does not need to be executable.
Executable flag on stack conflicts with some security measures, Systemd
MemoryDenyWriteExecute=yes for example.

lib/decompress/huf_decompress_amd64.S

index 83e3d75658a7a9b2606526acf625df393528177b..97646a2e192494cab7f18bd9258deaef0a82c62a 100644 (file)
@@ -1,5 +1,12 @@
 #if !defined(HUF_DISABLE_ASM) && defined(__x86_64__)
 
+/* Stack marking
+ * ref: https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart
+ */
+#if defined(__linux__) && defined(__ELF__)
+.section .note.GNU-stack,"",%progbits
+#endif
+
 /* Calling convention:
  *
  * %rdi contains the first argument: HUF_DecompressAsmArgs*.