pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/sysutils Apply patch backported from upstream, fixing ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/911b59cc9923
branches:  trunk
changeset: 356197:911b59cc9923
user:      bouyer <bouyer%pkgsrc.org@localhost>
date:      Wed Dec 21 15:35:44 2016 +0000

description:
Apply patch backported from upstream, fixing XSA-202
Bump PKGREVISION

diffstat:

 sysutils/xenkernel41/Makefile                                   |   4 +-
 sysutils/xenkernel41/distinfo                                   |   4 +-
 sysutils/xenkernel41/patches/patch-XSA-202                      |  73 ++++++++++
 sysutils/xenkernel41/patches/patch-xen_arch_x86_x86__64_entry.S |  13 -
 sysutils/xenkernel42/Makefile                                   |   4 +-
 sysutils/xenkernel42/distinfo                                   |   3 +-
 sysutils/xenkernel42/patches/patch-XSA-202                      |  69 +++++++++
 7 files changed, 150 insertions(+), 20 deletions(-)

diffs (237 lines):

diff -r 901a4c165586 -r 911b59cc9923 sysutils/xenkernel41/Makefile
--- a/sysutils/xenkernel41/Makefile     Wed Dec 21 13:40:24 2016 +0000
+++ b/sysutils/xenkernel41/Makefile     Wed Dec 21 15:35:44 2016 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.53 2016/12/20 10:22:28 bouyer Exp $
+# $NetBSD: Makefile,v 1.54 2016/12/21 15:35:44 bouyer Exp $
 
 VERSION=       4.1.6.1
 DISTNAME=      xen-${VERSION}
 PKGNAME=       xenkernel41-${VERSION}
-PKGREVISION=   22
+PKGREVISION=   23
 CATEGORIES=    sysutils
 MASTER_SITES=  http://bits.xensource.com/oss-xen/release/${VERSION}/
 
diff -r 901a4c165586 -r 911b59cc9923 sysutils/xenkernel41/distinfo
--- a/sysutils/xenkernel41/distinfo     Wed Dec 21 13:40:24 2016 +0000
+++ b/sysutils/xenkernel41/distinfo     Wed Dec 21 15:35:44 2016 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.46 2016/12/20 10:22:28 bouyer Exp $
+$NetBSD: distinfo,v 1.47 2016/12/21 15:35:44 bouyer Exp $
 
 SHA1 (xen-4.1.6.1.tar.gz) = e5f15feb0821578817a65ede16110c6eac01abd0
 RMD160 (xen-4.1.6.1.tar.gz) = bff11421fc44a26f2cc3156713267abcb36d7a19
@@ -45,12 +45,12 @@
 SHA1 (patch-XSA-192) = b0f2801fe6db91c2a98b82897cdee057062c6c2b
 SHA1 (patch-XSA-195) = a04295b397126e1cc1f129bb3cb9fb872fcbb373
 SHA1 (patch-XSA-200) = 2e5f6e3596fa754030af29a1dc8fafb738ad1da4
+SHA1 (patch-XSA-202) = ceb6f02eb7f1a41243c6e47c4f1bbbc9626a8da5
 SHA1 (patch-XSA-204) = 99e2b88b551d80724fcc27f925fbf65d3fc468de
 SHA1 (patch-xen_Makefile) = d1c7e4860221f93d90818f45a77748882486f92b
 SHA1 (patch-xen_arch_x86_Rules.mk) = 6b9b4bfa28924f7d3f6c793a389f1a7ac9d228e2
 SHA1 (patch-xen_arch_x86_cpu_mcheck_vmce.c) = 5afd01780a13654f1d21bf1562f6431c8370be0b
 SHA1 (patch-xen_arch_x86_time.c) = 2c69ac1cb5e0ca06c4f70acb91d2723a32ce98a9
-SHA1 (patch-xen_arch_x86_x86__64_entry.S) = 92bea7885c418e643bd9697abb9655bee9d1750b
 SHA1 (patch-xen_drivers_char_console_c) = 0fe186369602ccffaeec6f4bfbee8bb4298d3ff0
 SHA1 (patch-xen_drivers_passthrough_vtd_x86_ats.c) = 012ccbb27069c4f2e0361bd127397fdd22027f29
 SHA1 (patch-xen_include_xen_stdarg.h) = e9df974a9b783ed442ab17497198432cb9844b70
diff -r 901a4c165586 -r 911b59cc9923 sysutils/xenkernel41/patches/patch-XSA-202
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xenkernel41/patches/patch-XSA-202        Wed Dec 21 15:35:44 2016 +0000
@@ -0,0 +1,73 @@
+$NetBSD: patch-XSA-202,v 1.1 2016/12/21 15:35:44 bouyer Exp $
+
+From: Jan Beulich <jbeulich%suse.com@localhost>
+Subject: x86: force EFLAGS.IF on when exiting to PV guests
+
+Guest kernels modifying instructions in the process of being emulated
+for another of their vCPU-s may effect EFLAGS.IF to be cleared upon
+next exiting to guest context, by converting the being emulated
+instruction to CLI (at the right point in time). Prevent any such bad
+effects by always forcing EFLAGS.IF on. And to cover hypothetical other
+similar issues, also force EFLAGS.{IOPL,NT,VM} to zero.
+
+This is XSA-202.
+
+Signed-off-by: Jan Beulich <jbeulich%suse.com@localhost>
+
+ 
+--- xen/arch/x86/x86_64/compat/entry.S.orig    2014-09-02 08:22:57.000000000 +0200
++++ xen/arch/x86/x86_64/compat/entry.S 2016-12-21 13:23:21.000000000 +0100
+@@ -173,6 +173,10 @@
+ /* %rbx: struct vcpu, interrupts disabled */
+ ENTRY(compat_restore_all_guest)
+         ASSERT_INTERRUPTS_DISABLED
++      mov   $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11d
++      and   UREGS_eflags(%rsp),%r11d
++      or    $X86_EFLAGS_IF,%r11
++      mov   %r11d,UREGS_eflags(%rsp)
+         RESTORE_ALL
+         addq  $8,%rsp
+ .Lft0:  iretq
+--- xen/arch/x86/x86_64/entry.S.orig   2016-12-21 13:25:26.000000000 +0100
++++ xen/arch/x86/x86_64/entry.S        2016-12-21 13:32:36.000000000 +0100
+@@ -41,30 +41,29 @@
+         testw $TRAP_syscall,4(%rsp)
+         jz    iret_exit_to_guest
+ 
++      movq  24(%rsp),%r11           # RFLAGS
++      andq  $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11
++      orq   $X86_EFLAGS_IF,%r11
++
+         /* Don't use SYSRET path if the return address is not canonical. */
+         movq  8(%rsp),%rcx
+         sarq  $47,%rcx
+         incl  %ecx
+         cmpl  $1,%ecx
+-        ja    .Lforce_iret
++        movq  8(%rsp),%rcx            # RIP
++      ja    iret_exit_to_guest
+ 
+-        addq  $8,%rsp
+-        popq  %rcx                    # RIP
+-        popq  %r11                    # CS
+-        cmpw  $FLAT_USER_CS32,%r11
+-        popq  %r11                    # RFLAGS
+-        popq  %rsp                    # RSP
++        cmpw  $FLAT_USER_CS32,%r11w
++      movq  32(%rsp),%rsp           # RSP
+         je    1f
+         sysretq
+ 1:      sysretl
+ 
+-.Lforce_iret:
+-        /* Mimic SYSRET behavior. */
+-        movq  8(%rsp),%rcx            # RIP
+-        movq  24(%rsp),%r11           # RFLAGS
+         ALIGN
+ /* No special register assumptions. */
+ iret_exit_to_guest:
++      andl  $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),24(%rsp)
++      orl   $X86_EFLAGS_IF,24(%rsp)
+         addq  $8,%rsp
+ .Lft0:  iretq
+ 
diff -r 901a4c165586 -r 911b59cc9923 sysutils/xenkernel41/patches/patch-xen_arch_x86_x86__64_entry.S
--- a/sysutils/xenkernel41/patches/patch-xen_arch_x86_x86__64_entry.S   Wed Dec 21 13:40:24 2016 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,13 +0,0 @@
-$NetBSD: patch-xen_arch_x86_x86__64_entry.S,v 1.1 2016/03/01 20:09:04 joerg Exp $
-
---- xen/arch/x86/x86_64/entry.S.orig   2016-02-29 20:42:10.767055585 +0000
-+++ xen/arch/x86/x86_64/entry.S
-@@ -51,7 +51,7 @@ restore_all_guest:
-         addq  $8,%rsp
-         popq  %rcx                    # RIP
-         popq  %r11                    # CS
--        cmpw  $FLAT_USER_CS32,%r11
-+        cmpw  $FLAT_USER_CS32,%r11w
-         popq  %r11                    # RFLAGS
-         popq  %rsp                    # RSP
-         je    1f
diff -r 901a4c165586 -r 911b59cc9923 sysutils/xenkernel42/Makefile
--- a/sysutils/xenkernel42/Makefile     Wed Dec 21 13:40:24 2016 +0000
+++ b/sysutils/xenkernel42/Makefile     Wed Dec 21 15:35:44 2016 +0000
@@ -1,9 +1,9 @@
-# $NetBSD: Makefile,v 1.25 2016/12/20 10:22:28 bouyer Exp $
+# $NetBSD: Makefile,v 1.26 2016/12/21 15:35:44 bouyer Exp $
 
 VERSION=       4.2.5
 DISTNAME=      xen-${VERSION}
 PKGNAME=       xenkernel42-${VERSION}
-PKGREVISION=   14
+PKGREVISION=   15
 CATEGORIES=    sysutils
 MASTER_SITES=  http://bits.xensource.com/oss-xen/release/${VERSION}/
 
diff -r 901a4c165586 -r 911b59cc9923 sysutils/xenkernel42/distinfo
--- a/sysutils/xenkernel42/distinfo     Wed Dec 21 13:40:24 2016 +0000
+++ b/sysutils/xenkernel42/distinfo     Wed Dec 21 15:35:44 2016 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.24 2016/12/20 10:22:28 bouyer Exp $
+$NetBSD: distinfo,v 1.25 2016/12/21 15:35:44 bouyer Exp $
 
 SHA1 (xen-4.2.5.tar.gz) = f42741e4ec174495ace70c4b17a6b9b0e60e798a
 RMD160 (xen-4.2.5.tar.gz) = 7d4f7f1b32ee541d341a756b1f8da02816438d19
@@ -34,6 +34,7 @@
 SHA1 (patch-XSA-192) = f95757227ece59a2f320308edefcf01f1a96212c
 SHA1 (patch-XSA-195) = bb20234c4db0dc098ea47564732e87710bfcb9d8
 SHA1 (patch-XSA-200) = 2f615fa9c4ac43fc98f6c897acb5ee7e4651a668
+SHA1 (patch-XSA-202) = 0effaf281f31d7dadbd9c02cb51b1d29dd0014f9
 SHA1 (patch-XSA-204) = f6a59adf3cbd0aab59ccf233240a6b4e9ee2913b
 SHA1 (patch-xen_Makefile) = e0d1b74518b9675ddc64295d1523ded9a8757c0a
 SHA1 (patch-xen_arch_x86_Rules.mk) = 6b9b4bfa28924f7d3f6c793a389f1a7ac9d228e2
diff -r 901a4c165586 -r 911b59cc9923 sysutils/xenkernel42/patches/patch-XSA-202
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/xenkernel42/patches/patch-XSA-202        Wed Dec 21 15:35:44 2016 +0000
@@ -0,0 +1,69 @@
+$NetBSD: patch-XSA-202,v 1.1 2016/12/21 15:35:44 bouyer Exp $
+
+From: Jan Beulich <jbeulich%suse.com@localhost>
+Subject: x86: force EFLAGS.IF on when exiting to PV guests
+
+Guest kernels modifying instructions in the process of being emulated
+for another of their vCPU-s may effect EFLAGS.IF to be cleared upon
+next exiting to guest context, by converting the being emulated
+instruction to CLI (at the right point in time). Prevent any such bad
+effects by always forcing EFLAGS.IF on. And to cover hypothetical other
+similar issues, also force EFLAGS.{IOPL,NT,VM} to zero.
+
+This is XSA-202.
+
+Signed-off-by: Jan Beulich <jbeulich%suse.com@localhost>
+
+ 
+--- xen/arch/x86/x86_64/entry.S.orig
++++ xen/arch/x86/x86_64/entry.S
+@@ -41,28 +41,29 @@ restore_all_guest:
+         testw $TRAP_syscall,4(%rsp)
+         jz    iret_exit_to_guest
+ 
++        movq  24(%rsp),%r11           # RFLAGS
++        andq  $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11
++        orq   $X86_EFLAGS_IF,%r11
++
+         /* Don't use SYSRET path if the return address is not canonical. */
+         movq  8(%rsp),%rcx
+         sarq  $47,%rcx
+         incl  %ecx
+         cmpl  $1,%ecx
+-        ja    .Lforce_iret
++        movq  8(%rsp),%rcx            # RIP
++        ja    iret_exit_to_guest
+ 
+         cmpw  $FLAT_USER_CS32,16(%rsp)# CS
+-        movq  8(%rsp),%rcx            # RIP
+-        movq  24(%rsp),%r11           # RFLAGS
+         movq  32(%rsp),%rsp           # RSP
+         je    1f
+         sysretq
+ 1:      sysretl
+ 
+-.Lforce_iret:
+-        /* Mimic SYSRET behavior. */
+-        movq  8(%rsp),%rcx            # RIP
+-        movq  24(%rsp),%r11           # RFLAGS
+         ALIGN
+ /* No special register assumptions. */
+ iret_exit_to_guest:
++        andl  $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),24(%rsp)
++        orl   $X86_EFLAGS_IF,24(%rsp)
+         addq  $8,%rsp
+ .Lft0:  iretq
+ 
+--- xen/arch/x86/x86_64/compat/entry.S.orig    2014-09-02 08:22:57.000000000 +0200
++++ xen/arch/x86/x86_64/compat/entry.S 2016-12-21 13:23:21.000000000 +0100
+@@ -173,6 +173,10 @@
+ /* %rbx: struct vcpu, interrupts disabled */
+ ENTRY(compat_restore_all_guest)
+         ASSERT_INTERRUPTS_DISABLED
++      mov   $~(X86_EFLAGS_IOPL|X86_EFLAGS_NT|X86_EFLAGS_VM),%r11d
++      and   UREGS_eflags(%rsp),%r11d
++      or    $X86_EFLAGS_IF,%r11
++      mov   %r11d,UREGS_eflags(%rsp)
+         RESTORE_ALL
+         addq  $8,%rsp
+ .Lft0:  iretq



Home | Main Index | Thread Index | Old Index