WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] x86: INT3 and INTO trap gates should have

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: INT3 and INTO trap gates should have DPL==3.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Jan 2008 11:40:17 -0800
Delivery-date: Tue, 15 Jan 2008 11:40:58 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1200396555 0
# Node ID 973221f4d9c76b3efa3ce42dae97a41b03273737
# Parent  45d16899a21df6a36611e051e71f621a4439b4a7
x86: INT3 and INTO trap gates should have DPL==3.
This was broken by c/s 16667 (gdbstub changes).
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/traps.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff -r 45d16899a21d -r 973221f4d9c7 xen/arch/x86/traps.c
--- a/xen/arch/x86/traps.c      Sun Jan 13 10:50:18 2008 +0000
+++ b/xen/arch/x86/traps.c      Tue Jan 15 11:29:15 2008 +0000
@@ -2679,14 +2679,24 @@ asmlinkage void do_spurious_interrupt_bu
 {
 }
 
-void set_intr_gate(unsigned int n, void *addr)
+static void __set_intr_gate(unsigned int n, uint32_t dpl, void *addr)
 {
     int i;
     /* Keep secondary tables in sync with IRQ updates. */
     for ( i = 1; i < NR_CPUS; i++ )
         if ( idt_tables[i] != NULL )
-            _set_gate(&idt_tables[i][n], 14, 0, addr);
-    _set_gate(&idt_table[n], 14, 0, addr);
+            _set_gate(&idt_tables[i][n], 14, dpl, addr);
+    _set_gate(&idt_table[n], 14, dpl, addr);
+}
+
+static void set_swint_gate(unsigned int n, void *addr)
+{
+    __set_intr_gate(n, 3, addr);
+}
+
+void set_intr_gate(unsigned int n, void *addr)
+{
+    __set_intr_gate(n, 0, addr);
 }
 
 void set_tss_desc(unsigned int n, void *addr)
@@ -2753,8 +2763,8 @@ void __init trap_init(void)
     set_intr_gate(TRAP_divide_error,&divide_error);
     set_intr_gate(TRAP_debug,&debug);
     set_intr_gate(TRAP_nmi,&nmi);
-    set_intr_gate(TRAP_int3,&int3);         /* usable from all privileges */
-    set_intr_gate(TRAP_overflow,&overflow); /* usable from all privileges */
+    set_swint_gate(TRAP_int3,&int3);         /* usable from all privileges */
+    set_swint_gate(TRAP_overflow,&overflow); /* usable from all privileges */
     set_intr_gate(TRAP_bounds,&bounds);
     set_intr_gate(TRAP_invalid_op,&invalid_op);
     set_intr_gate(TRAP_no_device,&device_not_available);

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86: INT3 and INTO trap gates should have DPL==3., Xen patchbot-unstable <=