3 ms·
I would say that the issue isn't really mixing CET-aware and non-CET-aware code. The issue is using non-CET-aware code with CET enabled. If you have code that
by amluto 6y ago
I would say that the issue isn't really mixing CET-aware and non-CET-aware code. The issue is using non-CET-aware code with CET enabled. If you have code that plays games with mismatched CALL and RET or with rewriting the stack (which includes retpolines and possibly 32-bit PIC code), then SHSTK will make it crash. And if you have code that takes pointers to non-IBT functions, then you will crash unless you set up the legacy bitmap. But all of this is moot unless something turns CET on.
The actual semantics of when the combination of gcc, ld, and glibc will try to turn CET on are not documented, as far as I can tell.
And, to be fair, as my bug report shows, there can also be issues if something has a different ABI when compiled with and without CET enabled. This shouldn't happen, but apparently it did.
- mlyle 6y ago> The actual semantics of when the combination of gcc, ld, and glibc will try to turn CET on are not documented, as far as I can tell. Yes. And a complicating thing is here there's no loader or normal initialization code, because PXE is freestanding and invoked directly by the BIOS/EFI. CET is -probably- off... And yes, are there any dependencies between the init code changes and GCC enabling CET and GCC builtins?
- amluto 6y agoAny CET init code ought to be confined to glibc and/or the kernel or whatever code is untimely loading your program. I hope glibc isn’t involved in iPXE :). CET had better be off for UEFI programs when they’re loaded unless that program has a special header, based on spec that I doubt exists, telling the loader to enable CET.