summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>2002-05-05 03:19:48 +0000
committerbde <bde@FreeBSD.org>2002-05-05 03:19:48 +0000
commite129a7f152187872c6eb5efb7ecc6c8b82013088 (patch)
tree61a9fc3ffd6c6fedff283fff2aaf575dcaaa91eb
parent9fdf8815bfb582cb87f0fa996a7d5f0caeceeaed (diff)
downloadFreeBSD-src-e129a7f152187872c6eb5efb7ecc6c8b82013088.zip
FreeBSD-src-e129a7f152187872c6eb5efb7ecc6c8b82013088.tar.gz
Fixed checking for VM86 mode in doreti which I broke in rev.1.30. Only
the case of VM86 calls from the kernel was broken, so this bug was not a security hole. PR: 36710 Submitted by: David Xu <davidx@viasoft.com.cn> (version for RELENG_4) MFC after: 3 days
-rw-r--r--sys/i386/isa/ipl.s18
1 files changed, 12 insertions, 6 deletions
diff --git a/sys/i386/isa/ipl.s b/sys/i386/isa/ipl.s
index 78527f6..6fba56f 100644
--- a/sys/i386/isa/ipl.s
+++ b/sys/i386/isa/ipl.s
@@ -57,13 +57,19 @@
doreti:
FAKE_MCOUNT(bintr) /* init "from" bintr -> doreti */
doreti_next:
- /* Check if ASTs can be handled now. */
+ /*
+ * Check if ASTs can be handled now. PSL_VM must be checked first
+ * since segment registers only have an RPL in non-VM86 mode.
+ */
+ testl $PSL_VM,TF_EFLAGS(%esp) /* are we in vm86 mode? */
+ jz doreti_notvm86
+ cmpl $1,in_vm86call /* are we in a vm86 call? */
+ jne doreti_ast /* can handle ASTs now if not */
+ jmp doreti_exit
+
+doreti_notvm86:
testb $SEL_RPL_MASK,TF_CS(%esp) /* are we in user mode? */
- jne doreti_ast /* yes, do it now. */
- testl $PSL_VM,TF_EFLAGS(%esp) /* kernel mode */
- je doreti_exit /* and not VM86 mode, defer */
- cmpl $1,in_vm86call /* are we in a VM86 call? */
- je doreti_exit /* no, defer */
+ jz doreti_exit /* can't handle ASTs now if not */
doreti_ast:
/*
OpenPOWER on IntegriCloud