kondrak / vkQuake2

id Software's Quake 2 v3.21 with mission packs and Vulkan support (Windows, Linux, macOS, FreeBSD, Raspberry Pi 4)
GNU General Public License v2.0
896 stars 90 forks source link

Fix stack execution flag in linux assembly code #152

Closed GoGoOtaku closed 1 year ago

GoGoOtaku commented 1 year ago

I noticed that the Linux quake2 executable was flagged as having an executable stack. Since an executable stack could in theory be used for stack smashing some especially hardened systems will outright disallow the usage of code having an executable stack. Anyway the gnu assembler (used by GCC) can and will not automatically flag code as assembly is rather low level.

After testing the created object files of a release build I could assess that only linux/snd_mixa.s was causing issues. Further testing proved that the flag being set has to be after the id386l #endif

For more information you can read the Gentoo article on this subject: https://wiki.gentoo.org/wiki/Hardened/GNU_stack_quickstart

kondrak commented 1 year ago

Thanks!