fs-uae icon indicating copy to clipboard operation
fs-uae copied to clipboard

fs-uae isn't W^X safe

Open vext01 opened this issue 5 years ago • 2 comments

See here.

Thanks!

vext01 avatar Jul 23 '20 19:07 vext01

NetBSD similarly disallows pages to be W and X at the same time. The way to opt out of that differs from OpenBSD though (use the command paxctl +m executable.

Rhialto avatar Jul 23 '20 20:07 Rhialto

I better solution for this is to not generated nor use the code segment at all, it's actually not needed for GCC at least. You can check if the asm code segment is supported by your compiler (clang on BSD now?), and modify the #if ?

#if defined(__GNUC__)
        __asm__("fldcw %0" : : "m" (*&x87_cw));
#else
        if (x87_fldcw_code) {
                ((x87_fldcw_function) x87_fldcw_code)();
                return;
        }
#endif

FrodeSolheim avatar Feb 19 '21 17:02 FrodeSolheim