From: Heiko Carstens Date: Tue, 19 Feb 2008 14:29:34 +0000 (+0100) Subject: [S390] Fix futex_atomic_cmpxchg_std inline assembly. X-Git-Tag: Ubuntu-goldfish-3.4.0-4.27~19842^2~1 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=d5b02b3ff1d9a2e1074f559c84ed378cfa6fc3c0;p=mirror_ubuntu-zesty-kernel.git [S390] Fix futex_atomic_cmpxchg_std inline assembly. Add missing exception table entry so that the kernel can handle proctection exceptions as well on the cs instruction. Currently only specification exceptions are handled correctly. The missing entry allows user space to crash the kernel. Cc: stable Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- diff --git a/arch/s390/lib/uaccess_std.c b/arch/s390/lib/uaccess_std.c index 28c4500a58d0..d2ffbadb51a7 100644 --- a/arch/s390/lib/uaccess_std.c +++ b/arch/s390/lib/uaccess_std.c @@ -293,10 +293,10 @@ int futex_atomic_cmpxchg_std(int __user *uaddr, int oldval, int newval) asm volatile( " sacf 256\n" - " cs %1,%4,0(%5)\n" - "0: lr %0,%1\n" - "1: sacf 0\n" - EX_TABLE(0b,1b) + "0: cs %1,%4,0(%5)\n" + "1: lr %0,%1\n" + "2: sacf 0\n" + EX_TABLE(0b,2b) EX_TABLE(1b,2b) : "=d" (ret), "+d" (oldval), "=m" (*uaddr) : "0" (-EFAULT), "d" (newval), "a" (uaddr), "m" (*uaddr) : "cc", "memory" );