summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Jeanson <mjeanson@efficios.com>2026-02-20 11:01:00 -0500
committerAurelien Jarno <aurelien@aurel32.net>2026-03-29 12:47:57 +0200
commita56a2943d2ce541102c630142c2eae0fbfc5886b (patch)
tree87992081444e0695c7de62e8d6c3a0ba7d0d36a1
parent68099ccc941664481386c62cba40bbc5dac8b00e (diff)
tests: fix tst-rseq with Linux 7.0origin/release/2.42/master
A sub-test of tst-rseq is to validate the return code and errno of the rseq syscall when attempting to register the exact same rseq area as was done in the dynamic loader. This involves finding the rseq area address by adding the '__rseq_offset' to the thread pointer and calculating the area size from the AT_RSEQ_FEATURE_SIZE auxiliary vector. However the test currently calculates the size of the rseq area allocation in the TLS block which must be a multiple of AT_RSEQ_ALIGN. Up until now that happened to be the same value since the feature size and alignment exposed by the kernel were below the minimum ABI size of 32. Starting with Linux 7.0 the feature size has reached 33 while the alignment is now 64. This results in the test trying to re-register the rseq area with a different size and thus not getting the expected errno value. Signed-off-by: Michael Jeanson <mjeanson@efficios.com> Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> (cherry picked from commit 67f303b47dc584f204e3f2441b9832082415eebc)
-rw-r--r--sysdeps/unix/sysv/linux/tst-rseq.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/tst-rseq.c b/sysdeps/unix/sysv/linux/tst-rseq.c
index 00181cfefb..e83ea2b939 100644
--- a/sysdeps/unix/sysv/linux/tst-rseq.c
+++ b/sysdeps/unix/sysv/linux/tst-rseq.c
@@ -48,8 +48,7 @@ do_rseq_main_test (void)
size_t rseq_align = MAX (getauxval (AT_RSEQ_ALIGN), RSEQ_MIN_ALIGN);
size_t rseq_feature_size = MAX (getauxval (AT_RSEQ_FEATURE_SIZE),
RSEQ_AREA_SIZE_INITIAL_USED);
- size_t rseq_alloc_size = roundup (MAX (rseq_feature_size,
- RSEQ_AREA_SIZE_INITIAL_USED), rseq_align);
+ size_t rseq_reg_size = MAX (rseq_feature_size, RSEQ_AREA_SIZE_INITIAL);
struct rseq *rseq_abi = __thread_pointer () + __rseq_offset;
TEST_VERIFY_EXIT (rseq_thread_registered ());
@@ -89,8 +88,8 @@ do_rseq_main_test (void)
/* Test a rseq registration with the same arguments as the internal
registration which should fail with errno == EBUSY. */
TEST_VERIFY (((unsigned long) rseq_abi % rseq_align) == 0);
- TEST_VERIFY (__rseq_size <= rseq_alloc_size);
- int ret = syscall (__NR_rseq, rseq_abi, rseq_alloc_size, 0, RSEQ_SIG);
+ TEST_VERIFY (__rseq_size <= rseq_reg_size);
+ int ret = syscall (__NR_rseq, rseq_abi, rseq_reg_size, 0, RSEQ_SIG);
TEST_VERIFY (ret != 0);
TEST_COMPARE (errno, EBUSY);
}