From 571615d774ed3277c27e375563667ac60d995ee9 Mon Sep 17 00:00:00 2001 From: Tobias Weingartner Date: Wed, 12 Nov 2008 21:42:44 +0000 Subject: Add a comment to sigcode() to explain why the use of 'int $0x80' is necessary, so that future hackers will not be mislead the same way I was when looking at this code. --- sys/arch/amd64/amd64/locore.S | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sys/arch') diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S index e554a9d8440..bd569f17cf4 100644 --- a/sys/arch/amd64/amd64/locore.S +++ b/sys/arch/amd64/amd64/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.29 2008/10/24 06:32:17 deraadt Exp $ */ +/* $OpenBSD: locore.S,v 1.30 2008/11/12 21:42:43 weingart Exp $ */ /* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */ /* @@ -637,6 +637,12 @@ longmode_hi: /* * Signal trampoline; copied to top of user stack. + * + * Note, the "system call" to sigreturn() needs to be an 'int $0x80' one + * so that the kernel returns using 'iretq' method. This way if a process + * was interrupted (by tick) as opposed to in the kernel when a signal was + * being delivered, the process will be completely restored, including the + * userland %rcx register, which the 'sysret' instruction can not restore. */ NENTRY(sigcode) call *%rax -- cgit v1.2.3