KVM: s390: selftest: memop: Fix undefined behavior
authorNina Schoetterl-Glausch <nsg@linux.ibm.com>
Thu, 11 Jan 2024 09:48:05 +0000 (10:48 +0100)
committerJanosch Frank <frankja@linux.ibm.com>
Fri, 23 Feb 2024 13:02:27 +0000 (14:02 +0100)
commit00de073e2420df02ac0f1a19dbfb60ff8eb198be
tree024d4f7cb3eb4c058066997412b64fd45e5cdbde
parent85a19b3054274e09bcd9043d7d3203c3836688d0
KVM: s390: selftest: memop: Fix undefined behavior

If an integer's type has x bits, shifting the integer left by x or more
is undefined behavior.
This can happen in the rotate function when attempting to do a rotation
of the whole value by 0.

Fixes: 0dd714bfd200 ("KVM: s390: selftest: memop: Add cmpxchg tests")
Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>
Link: https://lore.kernel.org/r/20240111094805.363047-1-nsg@linux.ibm.com
Acked-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
Message-Id: <20240111094805.363047-1-nsg@linux.ibm.com>
tools/testing/selftests/kvm/s390x/memop.c