This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to add Pointer Authentication runtime trap error messages to compiler signal handler?

I am currently working on extending wasmtime, a WebAssembly runtime, to support ARMv8's Pointer Authentication (PAC) instructions (PACDZA and AUTDZA) for certain security increases. We also use MTE (Memory Tagging Extension), and we were able to set up handling MTE traps/exception signals fairly well, since we only had to handle the `SIG_SEGV` signal and then compare the `si_code` with `SEGV_MTESERR`. However, we now also want to implement handling traps/error messages for PAC instructions. In the documentation at https://www.kernel.org/doc/html/v5.12/arm64/pointer-authentication.html and the official ARM documentation I cannot find any mention of how PAC instructions communicate traps/authentication failures (though they would occur on loads after no or failed authentication). I read somewhere that the OS signal/trap that is sent for PAC traps from the hardware to the OS (linux) is asynchronous, making it hard/impossible to deterministically identify a trap as originating from PAC. Is this true? Is there at least any documentation somewhere describing this asynchronous nature? Or does anyone know of ways to identify a trap as coming from a PAC instruction, similar to how we did for MTE?

Thanks for the help and time!