mseal() and what comes after
mseal() and what comes after
Posted Oct 24, 2023 3:37 UTC (Tue) by calumapplepie (guest, #143655)In reply to: mseal() and what comes after by randomguy3
Parent article: mseal() and what comes after
How about we add a new flag on binaries, GNU_STACK_FORBID, which says "I solemnly swear that this program won't open anything with a GNU_STACK". Distributions can globally enable the flag on all their binaries, allowing ld.so to apply immutability to the stack.
Similar things can be done for other OpenBSD protections. Stuff like RAW_SYSCALL_FORBID (to block syscalls outside of libc), or a new section that declares what sections of the desired memory map are the stack to allow for the pointer protection. For most programs, the compiler knows where the stack is, and for the exceptions, distributors can remove the flags from binaries. Existing programs would obviously lack the flags, and just keep working.