[Glibc-bsd-commits] r4317 - branches/squeeze/kfreebsd-8/debian/patches

Steven Chamberlain stevenc-guest at alioth.debian.org
Sat Jun 16 17:45:50 UTC 2012


Author: stevenc-guest
Date: 2012-06-16 17:45:50 +0000 (Sat, 16 Jun 2012)
New Revision: 4317

Modified:
   branches/squeeze/kfreebsd-8/debian/patches/SA-12_04.sysret.patch
Log:
Upstream's commit to RELENG_8_1 looks wrong to me.  Moving this to where I think it belongs, based on the RELENG_7_4 commit.  Need to check this with upstream.


Modified: branches/squeeze/kfreebsd-8/debian/patches/SA-12_04.sysret.patch
===================================================================
--- branches/squeeze/kfreebsd-8/debian/patches/SA-12_04.sysret.patch	2012-06-16 17:24:56 UTC (rev 4316)
+++ branches/squeeze/kfreebsd-8/debian/patches/SA-12_04.sysret.patch	2012-06-16 17:45:50 UTC (rev 4317)
@@ -9,28 +9,36 @@
 Index: kfreebsd-8-8.1+dfsg/sys/amd64/amd64/trap.c
 ===================================================================
 --- kfreebsd-8-8.1+dfsg.orig/sys/amd64/amd64/trap.c	2012-06-16 18:22:30.000000000 +0100
-+++ kfreebsd-8-8.1+dfsg/sys/amd64/amd64/trap.c	2012-06-16 18:22:33.160013770 +0100
-@@ -972,6 +972,23 @@
++++ kfreebsd-8-8.1+dfsg/sys/amd64/amd64/trap.c	2012-06-16 18:41:54.231832727 +0100
+@@ -965,6 +965,23 @@
+ 	/*
+ 	 * Traced syscall.
+ 	 */
++
++	/*
++	 * If the user-supplied value of %rip is not a canonical
++	 * address, then some CPUs will trigger a ring 0 #GP during
++	 * the sysret instruction.  However, the fault handler would
++	 * execute with the user's %gs and %rsp in ring 0 which would
++	 * not be safe.  Instead, preemptively kill the thread with a
++	 * SIGBUS.
++	 */
++	if (td->td_frame->tf_rip >= VM_MAXUSER_ADDRESS) {
++		ksiginfo_init_trap(&ksi);
++		ksi.ksi_signo = SIGBUS;
++		ksi.ksi_code = BUS_OBJERR;
++		ksi.ksi_trapno = T_PROTFLT;
++		ksi.ksi_addr = (void *)td->td_frame->tf_rip;
++		trapsignal(td, &ksi);
++	}
+ 	if (orig_tf_rflags & PSL_T) {
+ 		frame->tf_rflags &= ~PSL_T;
+ 		ksiginfo_init_trap(&ksi);
+@@ -972,6 +989,7 @@
  		ksi.ksi_code = TRAP_TRACE;
  		ksi.ksi_addr = (void *)frame->tf_rip;
  		trapsignal(td, &ksi);
 +
-+		/*
-+		 * If the user-supplied value of %rip is not a canonical
-+		 * address, then some CPUs will trigger a ring 0 #GP during
-+		 * the sysret instruction.  However, the fault handler would
-+		 * execute with the user's %gs and %rsp in ring 0 which would
-+		 * not be safe.  Instead, preemptively kill the thread with a
-+		 * SIGBUS.
-+		 */
-+		if (td->td_frame->tf_rip >= VM_MAXUSER_ADDRESS) {
-+			ksiginfo_init_trap(&ksi);
-+			ksi.ksi_signo = SIGBUS;
-+			ksi.ksi_code = BUS_OBJERR;
-+			ksi.ksi_trapno = T_PROTFLT;
-+			ksi.ksi_addr = (void *)td->td_frame->tf_rip;
-+			trapsignal(td, &ksi);
-+		}
  	}
  
  	/*




More information about the Glibc-bsd-commits mailing list