Ginseng: Keeping secrets in registers when you distrust the operating system
Using a small trusted service that runs in a Trusted Execution Environment (TEE), for example, Intel SGX or as in this paper, ARM’s TrustZone, Ginseng can bypass the operating system for secure data transport to and from registers, ensure code integrity for functions handling sensitive data, and provide control-flow integrity for sensitive data itself. On a function call, the compiler emits instructions to send a request to the GService which encrypts the sensitive data and save it in the secure stack. A NOP instruction is inserted at the beginning of the exception vector code in the kernel, and replaced by a call to the secure monitor at runtime when sensitive data enters registers.
Source: blog.acolyer.org