3 ms·
They could, but attackers would still use the approach that works for them. And they can’t really remove the old instructions because of backwards compatibilit
by Someone 9y ago
They could, but attackers would still use the approach that works for them.
And they can’t really remove the old instructions because of backwards compatibility.
Whitelisting a limited set of instructions that can follow setting SS and making all others trap might be an option, though. It still would break backwards compatibility, but if the effective impact would be negligible, they could deem it acceptable.
- shawnz 9y agoThey could only do the interrupt disabling behaviour if the next instruction is in the whitelist, but not otherwise. EDIT: Although I guess it's almost certain to be an error anyway if it's not a whitelisted instruction.
- Someone 9y agoFollow-up: not only could they, they did. https://software.intel.com/sites/default/files/managed/7c/f1/253667-sdm-vol-2b.pdf https://software.intel.com/sites/default/files/managed/7c/f1..., page 4-385: “Loading the SS register with a POP instruction suppresses or inhibits some debug exceptions and inhibits interrupts on the following instruction boundary. (The inhibition ends after delivery of an exception or the execution of the next instruction.) This behavior allows a stack pointer to be loaded into the ESP register with the next instruction (POP ESP) before an event can be delivered. See Section 6.8.3, “Masking Exceptions and Interrupts When Switching Stacks,” in Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 3A. Intel recommends that software use the LSS instruction to load the SS register and ESP together.”
- yuhong 9y agoI bet whitelisting only instructions that can change SP/ESP would not break the majority of x86 code. All other instructions would behave as if MOV SS had not been executed.