Source-Changes-HG archive

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

[src/netbsd-6]: src Pull up following revision(s) (requested by maxv in ticke...



details:   https://anonhg.NetBSD.org/src/rev/781d43794d84
branches:  netbsd-6
changeset: 777251:781d43794d84
user:      snj <snj%NetBSD.org@localhost>
date:      Mon Sep 04 16:05:13 2017 +0000

description:
Pull up following revision(s) (requested by maxv in ticket #1501):
        sys/arch/sparc64/sparc64/compat_13_machdep.c: revision 1.24
Apply only CCR. Otherwise userland could set PSTATE_PRIV in %pstate and get
kernel privileges on the hardware.
ok martin

diffstat:

 doc/CHANGES-6.2                              |  8 +++++++-
 sys/arch/sparc64/sparc64/compat_13_machdep.c |  6 +++---
 2 files changed, 10 insertions(+), 4 deletions(-)

diffs (46 lines):

diff -r c65bfa14c734 -r 781d43794d84 doc/CHANGES-6.2
--- a/doc/CHANGES-6.2   Thu Aug 31 15:20:47 2017 +0000
+++ b/doc/CHANGES-6.2   Mon Sep 04 16:05:13 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.2,v 1.1.2.307 2017/08/31 15:20:47 martin Exp $
+# $NetBSD: CHANGES-6.2,v 1.1.2.308 2017/09/04 16:05:39 snj Exp $
 
 A complete list of changes from the 6.1 release until the 6.2 release:
 
@@ -20894,3 +20894,9 @@
        Fix FPU emulation.
        [mrg, ticket #1499]
 
+sys/arch/sparc64/sparc64/compat_13_machdep.c   1.24
+
+       Apply only CCR. Otherwise userland could set PSTATE_PRIV
+       in %pstate and get kernel privileges on the hardware.
+       [maxv, ticket #1501]
+
diff -r c65bfa14c734 -r 781d43794d84 sys/arch/sparc64/sparc64/compat_13_machdep.c
--- a/sys/arch/sparc64/sparc64/compat_13_machdep.c      Thu Aug 31 15:20:47 2017 +0000
+++ b/sys/arch/sparc64/sparc64/compat_13_machdep.c      Mon Sep 04 16:05:13 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_13_machdep.c,v 1.23 2009/11/21 04:16:52 rmind Exp $     */
+/*     $NetBSD: compat_13_machdep.c,v 1.23.18.1 2017/09/04 16:05:13 snj Exp $  */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_13_machdep.c,v 1.23 2009/11/21 04:16:52 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_13_machdep.c,v 1.23.18.1 2017/09/04 16:05:13 snj Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -129,7 +129,7 @@
                return (EINVAL);
        /* take only psr ICC field */
 #ifdef __arch64__
-       tf->tf_tstate = (int64_t)(tf->tf_tstate & ~TSTATE_CCR) | scp->sc_tstate;
+       tf->tf_tstate = (int64_t)(tf->tf_tstate & ~TSTATE_CCR) | (scp->sc_tstate & TSTATE_CCR);
 #else
        tf->tf_tstate = (int64_t)(tf->tf_tstate & ~TSTATE_CCR) | PSRCC_TO_TSTATE(scp->sc_psr);
 #endif



Home | Main Index | Thread Index | Old Index