Repository navigation
Conversation
If that's the case, you should definitively upstream your bug fix. |
|
I planed to do so, but do you confirm the duplication in boostorg/context#248 was a mistake? |
|
yes :) |
|
|
|
Oh, I didn't notice this. I will check |
|
The LINUX_X64_RELEASE_NTS job is the last one running Ubuntu 22.04 I believe, and in this version the Glibc loader doesn't enable SHSTK. The program crashes on the |
I think you re right, I get a SIGILL for those instructions in one intel machine but not the other (more modern distro). |
* Syscall number for map_shadow_stack has changed since initial support was added. * Use SYS_map_shadow_stack instead of hard-coded number when possible
The shadow stack may need as much space as the fiber stack in the worse case, so allocate a shadow stack the same size as the fiber stack. This matches what the kernel does for the main stack.
This fixes SHSTK support in fibers:
map_shadow_stackhas changed since initial support was added. I update the syscall number and use the SYS_map_shadow_stack macro instead of the hard coded number when possible. Note: when the configure check is broken, SHSTK is not disabled. Instead, SHSTK handling is not added, causing fibers to crash. So there is no risk of disabling a security feature by breaking this check.This can be tested with a kernel >= 6.6 and glibc >= 2.39, when compiling with
CFLAGS=-fcf-protection=full LDFLAGS=-Wl,-z,cet-report=error, and running withGLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK.Check that the binary was compiled with SHSTK:
Check CPU and kernel support:
Check that
ldenables SHSTK:See https://docs.kernel.org/next/x86/shstk.html
See https://www.phoronix.com/news/Glibc-Intel-CET-Shadow-Stack