]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/vDSO: Fix GNU hash table entry size for s390x
authorThomas Weißschuh <thomas.weissschuh@linutronix.de>
Mon, 17 Feb 2025 13:04:18 +0000 (14:04 +0100)
committerVasily Gorbik <gor@linux.ibm.com>
Tue, 4 Mar 2025 16:15:18 +0000 (17:15 +0100)
commita22ee38d2efe18edc53791fd1036396c23b43ad0
tree4c7a8f5c206ae73d04ea84850425cfa860fd5e89
parent5623bc23a1cb9f9a9470fa73b3a20321dc4c4870
selftests/vDSO: Fix GNU hash table entry size for s390x

Commit 14be4e6f3522 ("selftests: vDSO: fix ELF hash table entry size for s390x")
changed the type of the ELF hash table entries to 64bit on s390x.
However the *GNU* hash tables entries are always 32bit.
The "bucket" pointer is shared between both hash algorithms.
On s390, this caused the GNU hash algorithm to access its 32-bit entries as if they
were 64-bit, triggering compiler warnings (assignment between "Elf64_Xword *" and
"Elf64_Word *") and runtime crashes.

Introduce a new dedicated "gnu_bucket" pointer which is used by the GNU hash.

Fixes: e0746bde6f82 ("selftests/vDSO: support DT_GNU_HASH")
Reviewed-by: Jens Remus <jremus@linux.ibm.com>
Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Acked-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20250217-selftests-vdso-s390-gnu-hash-v2-1-f6c2532ffe2a@linutronix.de
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
tools/testing/selftests/vDSO/parse_vdso.c