From: Heiko Carstens Date: Tue, 7 Jan 2025 10:28:58 +0000 (+0100) Subject: s390/futex: Fix FUTEX_OP_ANDN implementation X-Git-Tag: v5.10.235~297 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3e5ffe0d29298bac3258aefcf9e0f068f323eaac;p=thirdparty%2Fkernel%2Fstable.git s390/futex: Fix FUTEX_OP_ANDN implementation commit 26701574cee6777f867f89b4a5c667817e1ee0dd upstream. 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: 3363fbdd6fb4 ("[PATCH] s390: futex atomic operations") Cc: stable@vger.kernel.org Signed-off-by: Heiko Carstens Acked-by: Alexander Gordeev Signed-off-by: Alexander Gordeev Signed-off-by: Greg Kroah-Hartman --- diff --git a/arch/s390/include/asm/futex.h b/arch/s390/include/asm/futex.h index e1d0b2aaaddd3..7be08c498ccda 100644 --- a/arch/s390/include/asm/futex.h +++ b/arch/s390/include/asm/futex.h @@ -45,7 +45,7 @@ static inline int arch_futex_atomic_op_inuser(int op, int oparg, int *oval, break; case FUTEX_OP_ANDN: __futex_atomic_op("lr %2,%1\nnr %2,%5\n", - ret, oldval, newval, uaddr, oparg); + ret, oldval, newval, uaddr, ~oparg); break; case FUTEX_OP_XOR: __futex_atomic_op("lr %2,%1\nxr %2,%5\n",