]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Jul 2014 14:49:52 +0000 (07:49 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Jul 2014 14:49:52 +0000 (07:49 -0700)
added patches:
s390-ptrace-fix-psw-mask-check.patch

queue-3.4/s390-ptrace-fix-psw-mask-check.patch [new file with mode: 0644]
queue-3.4/series

diff --git a/queue-3.4/s390-ptrace-fix-psw-mask-check.patch b/queue-3.4/s390-ptrace-fix-psw-mask-check.patch
new file mode 100644 (file)
index 0000000..169f32e
--- /dev/null
@@ -0,0 +1,50 @@
+From dab6cf55f81a6e16b8147aed9a843e1691dcd318 Mon Sep 17 00:00:00 2001
+From: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Date: Mon, 23 Jun 2014 15:29:40 +0200
+Subject: s390/ptrace: fix PSW mask check
+
+From: Martin Schwidefsky <schwidefsky@de.ibm.com>
+
+commit dab6cf55f81a6e16b8147aed9a843e1691dcd318 upstream.
+
+The PSW mask check of the PTRACE_POKEUSR_AREA command is incorrect.
+The PSW_MASK_USER define contains the PSW_MASK_ASC bits, the ptrace
+interface accepts all combinations for the address-space-control
+bits. To protect the kernel space the PSW mask check in ptrace needs
+to reject the address-space-control bit combination for home space.
+
+Fixes CVE-2014-3534
+
+Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Cc: Ben Hutchings <ben@decadent.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/s390/kernel/ptrace.c |    9 +++++++--
+ 1 file changed, 7 insertions(+), 2 deletions(-)
+
+--- a/arch/s390/kernel/ptrace.c
++++ b/arch/s390/kernel/ptrace.c
+@@ -292,7 +292,9 @@ static int __poke_user(struct task_struc
+                * psw and gprs are stored on the stack
+                */
+               if (addr == (addr_t) &dummy->regs.psw.mask &&
+-                  ((data & ~PSW_MASK_USER) != psw_user_bits ||
++                  (((data^psw_user_bits) & ~PSW_MASK_USER) ||
++                   (((data^psw_user_bits) & PSW_MASK_ASC) &&
++                    ((data|psw_user_bits) & PSW_MASK_ASC) == PSW_MASK_ASC) ||
+                    ((data & PSW_MASK_EA) && !(data & PSW_MASK_BA))))
+                       /* Invalid psw mask. */
+                       return -EINVAL;
+@@ -595,7 +597,10 @@ static int __poke_user_compat(struct tas
+                */
+               if (addr == (addr_t) &dummy32->regs.psw.mask) {
+                       /* Build a 64 bit psw mask from 31 bit mask. */
+-                      if ((tmp & ~PSW32_MASK_USER) != psw32_user_bits)
++                      if (((tmp^psw32_user_bits) & ~PSW32_MASK_USER) ||
++                          (((tmp^psw32_user_bits) & PSW32_MASK_ASC) &&
++                           ((tmp|psw32_user_bits) & PSW32_MASK_ASC)
++                           == PSW32_MASK_ASC))
+                               /* Invalid psw mask. */
+                               return -EINVAL;
+                       regs->psw.mask = (regs->psw.mask & ~PSW_MASK_USER) |
index 14328e0799e65b5b0c2684bae1173cd92918f81c..5d5fe16d80525b5c733378d64438d0f191006829 100644 (file)
@@ -5,3 +5,4 @@ ahci-add-support-for-the-promise-fasttrak-tx8660-sata-hba-ahci-mode.patch
 x86_32-entry-store-badsys-error-code-in-eax.patch
 mm-hugetlb-fix-copy_hugetlb_page_range.patch
 fix-gcc-4.9.0-miscompilation-of-load_balance-in-scheduler.patch
+s390-ptrace-fix-psw-mask-check.patch