diff options
| author | Thomas Huth <thuth@redhat.com> | 2026-07-09 18:43:40 +0200 |
|---|---|---|
| committer | Mickaël Salaün <mic@digikod.net> | 2026-07-10 12:59:11 +0200 |
| commit | d793186aa3bb833c878ae6826c87e62c843afaa3 (patch) | |
| tree | 0f28bda1f1f1628cd1f671bb117ff0ae42500c22 /scripts/bash-completion | |
| parent | 97c0e344e03818dbf3116e77d3d7fe81f1fbe795 (diff) | |
selftests/landlock: Fix screwed up pointers in the scoped_signal_test
The scoped_signal_test uses pthread_join(..., (void **)&ret)) in
a couple of places, i.e. the return value of the thread is stored
in the shape of a "void *" into the memory location of &ret.
Pointers are 64-bit on modern computers, but the ret variable is
declared as a simple "enum thread_return" which is only 32 bits.
So the pthread_join() will overflow the ret variable by 4 byte.
The problem is very visible on big endian systems like s390x
where the test is failing: The least significant byte that carries
the return code of the thread is not written into the ret variable
here, but somewhere else in the stack frame, so the comparison
for the right return code is failing here.
Fix it by getting rid of the enum and defining the THREAD_* constants
and "ret" variables as proper "void *" pointers. This way we can
also get rid of some ugly (void *) castings in a couple of spots.
Signed-off-by: Thomas Huth <thuth@redhat.com>
Link: https://patch.msgid.link/20260709164340.339656-1-thuth@redhat.com
Cc: stable@vger.kernel.org
Fixes: c8994965013e ("selftests/landlock: Test signal scoping for threads")
[mic: Add clang-format markups]
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Diffstat (limited to 'scripts/bash-completion')
0 files changed, 0 insertions, 0 deletions
