Index: kernel/arch/amd64/src/asm.S
===================================================================
--- kernel/arch/amd64/src/asm.S	(revision 28f4adbc5088d8d67ea408f56eb3b35838031e6a)
+++ kernel/arch/amd64/src/asm.S	(revision c75698b941dcd25fb9a093edcff36a8e3bf8e2e6)
@@ -386,4 +386,16 @@
 	movq ISTATE_OFFSET_RSP(%rsp), %rsp
 
+	/*
+	 * Clear the rest of the scratch registers to prevent information leak.
+	 * The 32-bit XOR on the low GPRs actually clears the entire 64-bit
+	 * register and the instruction is shorter.
+	 */
+	xorl %edx, %edx
+	xorl %esi, %esi
+	xorl %edi, %edi
+	xorq %r8, %r8
+	xorq %r9, %r9
+	xorq %r10, %r10
+
 	sysretq
 
