summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2015-07-17 15:37:58 +0000
committerguenther <guenther@openbsd.org>2015-07-17 15:37:58 +0000
commit92f33f2bb65ae8b27b024b0d49f66a90df48c984 (patch)
tree6fcef470ec0f6ee98645225b3c66ac4900e2ae60
parentIn socketpair(), need to mask the type argument when testing for dgram. (diff)
downloadwireguard-openbsd-92f33f2bb65ae8b27b024b0d49f66a90df48c984.tar.xz
wireguard-openbsd-92f33f2bb65ae8b27b024b0d49f66a90df48c984.zip
Consistently use SEL_RPL as the mask when testing selector privilege level
-rw-r--r--sys/arch/amd64/amd64/locore.S4
-rw-r--r--sys/arch/amd64/amd64/vector.S4
-rw-r--r--sys/arch/amd64/include/frameasm.h4
3 files changed, 6 insertions, 6 deletions
diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S
index df4cea82082..46f20f7d6e3 100644
--- a/sys/arch/amd64/amd64/locore.S
+++ b/sys/arch/amd64/amd64/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.71 2015/07/17 06:13:44 mlarkin Exp $ */
+/* $OpenBSD: locore.S,v 1.72 2015/07/17 15:37:58 guenther Exp $ */
/* $NetBSD: locore.S,v 1.13 2004/03/25 18:33:17 drochner Exp $ */
/*
@@ -1128,7 +1128,7 @@ NENTRY(intr_fast_exit)
movq TF_RBP(%rsp),%rbp
movq TF_RBX(%rsp),%rbx
- testq $SEL_UPL,TF_CS(%rsp)
+ testq $SEL_RPL,TF_CS(%rsp)
je 5f
INTR_RESTORE_SELECTORS
diff --git a/sys/arch/amd64/amd64/vector.S b/sys/arch/amd64/amd64/vector.S
index 486495c2cd1..3d752abfc1e 100644
--- a/sys/arch/amd64/amd64/vector.S
+++ b/sys/arch/amd64/amd64/vector.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: vector.S,v 1.42 2015/07/16 05:10:14 guenther Exp $ */
+/* $OpenBSD: vector.S,v 1.43 2015/07/17 15:37:58 guenther Exp $ */
/* $NetBSD: vector.S,v 1.5 2004/06/28 09:13:11 fvdl Exp $ */
/*
@@ -153,7 +153,7 @@ IDTVEC(trap0d)
leaq _C_LABEL(doreti_iret)(%rip),%rdi
cmpq %rdi,TF_RIP(%rsp)
je 1f
- testq $SEL_UPL,TF_CS(%rsp)
+ testq $SEL_RPL,TF_CS(%rsp)
jz 2f
1: swapgs
2: movq %r15,TF_R15(%rsp)
diff --git a/sys/arch/amd64/include/frameasm.h b/sys/arch/amd64/include/frameasm.h
index b06d1bffb35..b3ec74e7365 100644
--- a/sys/arch/amd64/include/frameasm.h
+++ b/sys/arch/amd64/include/frameasm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: frameasm.h,v 1.8 2015/05/18 19:59:27 guenther Exp $ */
+/* $OpenBSD: frameasm.h,v 1.9 2015/07/17 15:37:58 guenther Exp $ */
/* $NetBSD: frameasm.h,v 1.1 2003/04/26 18:39:40 fvdl Exp $ */
#ifndef _AMD64_MACHINE_FRAMEASM_H
@@ -32,7 +32,7 @@
#define INTRENTRY \
subq $32,%rsp ; \
- testq $SEL_UPL,56(%rsp) ; \
+ testq $SEL_RPL,56(%rsp) ; \
je 98f ; \
swapgs ; \
98: INTR_SAVE_GPRS