clang -fret-clean on the horizon for OpenBSD/arm64
by from OpenBSD Journal on (#6NZ39)
While we were busy with other things, Theo de Raadt (deraadt@) is continuing the work on bringing the clang option to clean return addresses off the stack, as reported upon earlier, to OpenBSD/arm64.
Theo posted an early version of the code to tech@, saying
List: openbsd-techSubject: arm64 -fret-clean attemptFrom: "Theo de Raadt" <deraadt () openbsd ! org>Date: 2024-07-02 5:50:45I've been trying to write -fret-clean for arm64.On a return-stack architecture like amd64, the callee has to clean up theword on the stack upon return.arm64, like some other risc architectures, is a link-register architecture.In this case, the return address is saved in some temporary location bythe caller, who loads it into the link register before returning. Beforethat moment, the caller has to clean it up.