diff options
author | 2019-04-01 08:43:29 +0000 | |
---|---|---|
committer | 2019-04-01 08:43:29 +0000 | |
commit | 0c4bf09db4a1ca36e37fb20a884133be86fdae7a (patch) | |
tree | 49723c89993bc840288625aeb0fe8c79ef7fdd30 | |
parent | In the upstreamed and official device tree for i.MX8MQ the USB phys (diff) | |
download | wireguard-openbsd-0c4bf09db4a1ca36e37fb20a884133be86fdae7a.tar.xz wireguard-openbsd-0c4bf09db4a1ca36e37fb20a884133be86fdae7a.zip |
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 /*****************************************************************************/ |