Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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 <stable@kernel.org>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Heiko Carstens and committed by
Martin Schwidefsky
d5b02b3f 39f73b28

+4 -4
+4 -4
arch/s390/lib/uaccess_std.c
··· 293 293 294 294 asm volatile( 295 295 " sacf 256\n" 296 - " cs %1,%4,0(%5)\n" 297 - "0: lr %0,%1\n" 298 - "1: sacf 0\n" 299 - EX_TABLE(0b,1b) 296 + "0: cs %1,%4,0(%5)\n" 297 + "1: lr %0,%1\n" 298 + "2: sacf 0\n" 299 + EX_TABLE(0b,2b) EX_TABLE(1b,2b) 300 300 : "=d" (ret), "+d" (oldval), "=m" (*uaddr) 301 301 : "0" (-EFAULT), "d" (newval), "a" (uaddr), "m" (*uaddr) 302 302 : "cc", "memory" );