@@ -204,6 +204,14 @@ static bool ex_handler_eretu(const struct exception_table_entry *fixup,
unsigned short ss = uregs->ss;
unsigned short cs = uregs->cs;
+ /*
+ * A FRED stack frame generated by a ring 3 event should never be
+ * messed up, and the first thing we must make sure is that at the
+ * time an ERETU instruction is executed, %rsp must have the same
+ * address as that when the user level event was just delivered.
+ */
+ BUG_ON(uregs != current->thread_info.user_pt_regs);
+
/*
* Move the NMI bit from the invalid stack frame, which caused ERETU
* to fault, to the fault handler's stack frame, thus to unblock NMI