diff options
author | mortimer <mortimer@cvs.openbsd.org> | 2019-04-01 08:43:30 +0000 |
---|---|---|
committer | mortimer <mortimer@cvs.openbsd.org> | 2019-04-01 08:43:30 +0000 |
commit | cf777085cc3181935eb4eebcb9d28a0f1c4e9cfc (patch) | |
tree | afa36a264522c87a0d8241df750560f5cf57591d | |
parent | 2bb363f89aa102406c1fe1fb41b3323d2685f661 (diff) |
Add retguard macros to kernel setjmp / longjmp.
ok deraadt@ kettenis@
-rw-r--r-- | sys/arch/amd64/amd64/locore.S | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S index 973d343e940..15b04e2f9be 100644 --- a/sys/arch/amd64/amd64/locore.S +++ b/sys/arch/amd64/amd64/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.114 2019/02/18 08:26:19 yasuoka Exp $ */ +/* $OpenBSD: locore.S,v 1.115 2019/04/01 08:43:29 mortimer Exp $ */ /* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */ /* @@ -271,6 +271,7 @@ NENTRY(lgdt) lretq ENTRY(setjmp) + RETGUARD_SETUP(setjmp, r11) /* * Only save registers that must be preserved across function * calls according to the ABI (%rbx, %rsp, %rbp, %r12-%r15) @@ -287,21 +288,24 @@ ENTRY(setjmp) movq (%rsp),%rdx movq %rdx,56(%rax) xorl %eax,%eax + RETGUARD_CHECK(setjmp, r11) ret ENTRY(longjmp) movq %rdi,%rax - movq (%rax),%rbx movq 8(%rax),%rsp + movq 56(%rax),%rdx + movq %rdx,(%rsp) + RETGUARD_SETUP(longjmp, r11) + movq (%rax),%rbx movq 16(%rax),%rbp movq 24(%rax),%r12 movq 32(%rax),%r13 movq 40(%rax),%r14 movq 48(%rax),%r15 - movq 56(%rax),%rdx - movq %rdx,(%rsp) xorl %eax,%eax incl %eax + RETGUARD_CHECK(longjmp, r11) ret /*****************************************************************************/ |