Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d5b02b3f authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky
Browse files

[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: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 39f73b28
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -293,10 +293,10 @@ int futex_atomic_cmpxchg_std(int __user *uaddr, int oldval, int newval)


	asm volatile(
	asm volatile(
		"   sacf 256\n"
		"   sacf 256\n"
		"   cs   %1,%4,0(%5)\n"
		"0: cs   %1,%4,0(%5)\n"
		"0: lr   %0,%1\n"
		"1: lr   %0,%1\n"
		"1: sacf 0\n"
		"2: sacf 0\n"
		EX_TABLE(0b,1b)
		EX_TABLE(0b,2b) EX_TABLE(1b,2b)
		: "=d" (ret), "+d" (oldval), "=m" (*uaddr)
		: "=d" (ret), "+d" (oldval), "=m" (*uaddr)
		: "0" (-EFAULT), "d" (newval), "a" (uaddr), "m" (*uaddr)
		: "0" (-EFAULT), "d" (newval), "a" (uaddr), "m" (*uaddr)
		: "cc", "memory" );
		: "cc", "memory" );