Korona wrote:You don't need to trigger the page fault. You can suppress it using TSX. You can (probably, I didn't test this) put code that triggers legitimate page faults (to not-yet swapped-in pages) in front of the mov and it will still be speculatively executed.
TSX is probably new enough as to make it irrelevant at least for important legacy hardware, and it could be that it's found in a small margin of existing CPUs so it would be less critical to find newer CPUs without the design flaw, but deeming hardware useless just for this couldn't be true, in fact it's starting to educate everyone about paging, memory management, caching, optimizing code, Assembly language, C language, kernel development...
If you invalidate the data cache at the start and end of program switches, at least selectively for some programs, data cache would still be clean with no old cache since the last task switch time or cache from other programs, and would be unusable for this attack.
The OS could still be configured to enable or disable TSX, for example, in an extremely high security environment like a virtual remote machine account, that feature could be turned off to force page fault management by the OS, it could also be configured for each program, always fine-tuning more consciously the applications that the human users and that obviously good known programs know that aren't malware. If not, the safest options could be used by default (no TSX) and still we would have the remaining choices using basic protection mechanisms and better synchronization to prevent the other attack variations.
In some environments TSX could be forced disabled even if the program requested the OS to enable it so that human users and long-running, long-installed, long-present binaries enable those features automatically or manually as they are more used.
If it's possible to keep clean the cache between processes and flush it at any faults/exceptions, flushing despite bogus out-of-order execution using synchronization in the kernel, as well as keeping selected pages cache-disabled for private data, then it won't be so difficult to fix, but has to be implemented and run to see if it really stops the attack, we can't know without executing these measures.
________________________________________
________________________________________
We would still need to reproduce the bug for implementing OS code that really solves something, not just designing it based on suspicion of how things work if we don't actually know first how a vulnerability works as to write code that instead of trying to patch problems, handles the memory/cache resources better to not even have things to patch.