]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Add S390 futex fix
authorChris Wright <chrisw@sous-sol.org>
Sat, 22 Mar 2008 18:29:31 +0000 (11:29 -0700)
committerChris Wright <chrisw@sous-sol.org>
Sat, 22 Mar 2008 18:29:31 +0000 (11:29 -0700)
review-2.6.24/s390-futex-let-futex_atomic_cmpxchg_pt-survive-early-functional-tests.patch [new file with mode: 0644]
review-2.6.24/series

diff --git a/review-2.6.24/s390-futex-let-futex_atomic_cmpxchg_pt-survive-early-functional-tests.patch b/review-2.6.24/s390-futex-let-futex_atomic_cmpxchg_pt-survive-early-functional-tests.patch
new file mode 100644 (file)
index 0000000..86c3ae0
--- /dev/null
@@ -0,0 +1,35 @@
+From 504e75d0ed3389747e40a4aaa4b1f4e569576665 Mon Sep 17 00:00:00 2001
+From: Heiko Carstens <heiko.carstens@de.ibm.com>
+Date: Thu, 20 Mar 2008 17:33:38 +0100
+Message-ID: <20080322161918.GA6367@osiris.boeblingen.de.ibm.com>
+Subject: S390 futex: let futex_atomic_cmpxchg_pt survive early functional tests.
+
+a0c1e9073ef7428a14309cba010633a6cd6719ea "futex: runtime enable pi and
+robust functionality" introduces a test wether futex in atomic stuff
+works or not.
+It does that by writing to address 0 of the kernel address space. This
+will crash on older machines where addressing mode switching is enabled
+but where the mvcos instruction is not available. Page table walking is
+done by hand and therefore the code tries to access current->mm which
+is NULL.
+Therefore add an extra check, so we survive the early test.
+
+Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
+Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Chris Wright <chrisw@sous-sol.org>
+---
+ arch/s390/lib/uaccess_pt.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/arch/s390/lib/uaccess_pt.c
++++ b/arch/s390/lib/uaccess_pt.c
+@@ -406,6 +406,8 @@ int futex_atomic_cmpxchg_pt(int __user *
+ {
+       int ret;
++      if (!current->mm)
++              return -EFAULT;
+       spin_lock(&current->mm->page_table_lock);
+       uaddr = (int __user *) __dat_user_addr((unsigned long) uaddr);
+       if (!uaddr) {
index 8c3e9d15a46407d2bf0a6c0472b3edd0a2e99c2c..ec01723d1440c4cd8c3e64c04fcdfd04263ad5c1 100644 (file)
@@ -75,3 +75,4 @@ scsi-advansys-fix-bug-in-advloadmicrocode.patch
 bluetooth-fix-bugs-in-previous-conn-add-del-workqueue-changes.patch
 relay-fix-subbuf_splice_actor-adding-too-many-pages.patch
 slab-numa-slab-allocator-migration-bugfix.patch
+s390-futex-let-futex_atomic_cmpxchg_pt-survive-early-functional-tests.patch