Skip to content

Commit

Permalink
Mark Huffman Decoder Assembly noexecstack on All Architectures
Browse files Browse the repository at this point in the history
Apparently, even when the assembly file is empty (because
`ZSTD_ENABLE_ASM_X86_64_BMI2` is false), it still is marked as possibly
needing an executable stack and so the whole library is marked as such. This
commit applies a simple patch for this problem by moving the noexecstack
indication outside the macro guard.

This commit builds on facebook#2857.

This commit addresses facebook#2963.
  • Loading branch information
felixhandte committed Dec 30, 2021
1 parent fb14e22 commit 9a9d1ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/decompress/huf_decompress_amd64.S
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include "../common/portability_macros.h"

#if ZSTD_ENABLE_ASM_X86_64_BMI2

/* Stack marking
* ref: https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart
*/
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

#if ZSTD_ENABLE_ASM_X86_64_BMI2

/* Calling convention:
*
* %rdi contains the first argument: HUF_DecompressAsmArgs*.
Expand Down

0 comments on commit 9a9d1ec

Please # to comment.