Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7-1]: src/sys/arch Pull up following revision(s) (requested by ma...



details:   https://anonhg.NetBSD.org/src/rev/fc65033ec746
branches:  netbsd-7-1
changeset: 800715:fc65033ec746
user:      snj <snj%NetBSD.org@localhost>
date:      Sat Mar 25 16:58:24 2017 +0000

description:
Pull up following revision(s) (requested by maxv in ticket #1391):
        sys/arch/amd64/amd64/trap.c: revision 1.94
        sys/arch/i386/i386/trap.c: revision 1.287
Mmh, allow iret to be handled when an #SS fault (T_STKFLT) happens. Even
if the sdm is far from being clear, it appears that iret can trigger an #SS
fault if %ss points to a writable but non-present segment; in which case
the kernel would panic, thinking the fault was internal to it.
In particular, userland can create a broken segment in the ldt with
USER_LDT, update its %ss with setcontext and trigger the panic. I don't
think amd64 is affected since USER_LDT does not exist there, and the
changes on tf_ss seem correct - but I'm still adding T_STKFLT for safety.

diffstat:

 sys/arch/amd64/amd64/trap.c |  5 +++--
 sys/arch/i386/i386/trap.c   |  5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diffs (52 lines):

diff -r ba7964818754 -r fc65033ec746 sys/arch/amd64/amd64/trap.c
--- a/sys/arch/amd64/amd64/trap.c       Mon Mar 20 10:58:16 2017 +0000
+++ b/sys/arch/amd64/amd64/trap.c       Sat Mar 25 16:58:24 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.78 2014/03/11 20:54:29 para Exp $   */
+/*     $NetBSD: trap.c,v 1.78.10.1 2017/03/25 16:58:24 snj Exp $       */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.78 2014/03/11 20:54:29 para Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.78.10.1 2017/03/25 16:58:24 snj Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -301,6 +301,7 @@
        case T_PROTFLT:
        case T_SEGNPFLT:
        case T_ALIGNFLT:
+       case T_STKFLT:
        case T_TSSFLT:
                if (p == NULL)
                        goto we_re_toast;
diff -r ba7964818754 -r fc65033ec746 sys/arch/i386/i386/trap.c
--- a/sys/arch/i386/i386/trap.c Mon Mar 20 10:58:16 2017 +0000
+++ b/sys/arch/i386/i386/trap.c Sat Mar 25 16:58:24 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.272 2014/03/12 18:59:07 martin Exp $        */
+/*     $NetBSD: trap.c,v 1.272.10.1 2017/03/25 16:58:25 snj Exp $      */
 
 /*-
  * Copyright (c) 1998, 2000, 2005, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.272 2014/03/12 18:59:07 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.272.10.1 2017/03/25 16:58:25 snj Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -349,6 +349,7 @@
        case T_PROTFLT:
        case T_SEGNPFLT:
        case T_ALIGNFLT:
+       case T_STKFLT:
        case T_TSSFLT:
                if (p == NULL)
                        goto we_re_toast;



Home | Main Index | Thread Index | Old Index