The NX bit is not just about security

21 points by fanf


juliaaa

We ran into this in the seL4 boot loaders as well(unverified code). More specifically, someone from STM32 contributing platform support for the STM32MP2 did, on a Cortex-A35.

Slightly different, it was ret vs br x30, but same idea - ret got predicted whilst br x30 did not. This time it was memory protected by STM's RIF (resource isolation framework).

We solved it a slightly different way, by only mapping the necessary memory, but then we're a bootloader not a hypervisor.

Funnily enough, the ZynqMP (ZCU102) board had been having periodic failures booting in 32-bit mode every so often (not consistent even with the same binary), and this solved it

CPUs don’t signal page faults for speculative accesses

This is not strictly true - the CPU core won't (which is what produces page faults, so technically correct), but on ARM, such as in the case with the RIF, speculative accesses that make it out to the system bus and to various peripherals can produce SErrors.

valpackett

Oh wow. The first issue found on the way is a lot more "nightmare fuel" than the main event:

modifications to the data do not automatically propagate to the instruction fetches

I guess I never really even realized that that was the case because… well, modifying instructions is generally not something I would do just for fun, but that's quite the footgun for those rare cases when that happens.