This patch adds a shadow stack fix when compiling setjmp/longjmp with the shadow stack enabled. This allows setjmp/longjmp to work correctly with CET.
|27560 ↗||(On Diff #144313)|
Variable names should be capitalized.
|27797 ↗||(On Diff #144313)|
Can we use MOV64ri32 instead of MOV64ri? That would only use 32-bits for the immediate instead of 64.
Or better yet, can you use XOR?
|27807 ↗||(On Diff #144313)|
Can the be "TEST reg, reg" instead of CMP? Should be shorter encoding that putting 0 in the immediate. Even if not CMP64ri8/CMP32ri8 should be shorter than the ri32/ri versions.
|27863 ↗||(On Diff #144313)|
Single shifts should use SHL64r1/SHL32r1
|76 ↗||(On Diff #144543)|
This part ensures that we increment the SSP beyond the value in the low 8 bits of ecx on the last incsspd use. This means that we need to further increment the SSP by ecx * 256 at the start of this block. We cannot express that 256 in 8 bits, so instead we increment by (2 * ecx) * 128. So using 255 doesn't fit the logic of this part. Same goes for the 64-bit version.