From 26e632d174731816bf951953a0b18eafb7ce47bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Mei=C3=9Fner?= Date: Thu, 26 Sep 2024 00:47:41 +0200 Subject: [PATCH] Zero out RBP in order not to compromise the environment encryption. --- src/jit.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/jit.rs b/src/jit.rs index c90994d06..d29644e4b 100644 --- a/src/jit.rs +++ b/src/jit.rs @@ -109,6 +109,8 @@ impl JitProgram { unsafe { std::arch::asm!( // RBP is saved and restored automatically by the surrounding function. + // It is zeroed out in order not to compromise the runtime environment (RDI) encryption. + "xor rbp, rbp", // RBX must be saved and restored manually in the current version of rustc and llvm. "push rbx", "mov [{host_stack_pointer}], rsp",