Skip to content

Commit 2670157

Browse files
hcahcaAlexander Gordeev
authored andcommitted
s390/futex: Fix FUTEX_OP_ANDN implementation
The futex operation FUTEX_OP_ANDN is supposed to implement *(int *)UADDR2 &= ~OPARG; The s390 implementation just implements an AND instead of ANDN. Add the missing bitwise not operation to oparg to fix this. This is broken since nearly 19 years, so it looks like user space is not making use of this operation. Fixes: 3363fbd ("[PATCH] s390: futex atomic operations") Cc: stable@vger.kernel.org Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Acked-by: Alexander Gordeev <agordeev@linux.ibm.com> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
1 parent 0d30871 commit 2670157

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/s390/include/asm/futex.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static inline int arch_futex_atomic_op_inuser(int op, int oparg, int *oval,
4444
break;
4545
case FUTEX_OP_ANDN:
4646
__futex_atomic_op("lr %2,%1\nnr %2,%5\n",
47-
ret, oldval, newval, uaddr, oparg);
47+
ret, oldval, newval, uaddr, ~oparg);
4848
break;
4949
case FUTEX_OP_XOR:
5050
__futex_atomic_op("lr %2,%1\nxr %2,%5\n",

0 commit comments

Comments
 (0)