Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rseq/selftests: Fix namespace collision with rseq UAPI header

When the rseq UAPI header is included, 'union rseq' clashes with 'struct
rseq'. It's not the case in the rseq selftests but it does break the KVM
selftests that also include this file.

Rename 'union rseq' to 'union rseq_tls' to fix this.

Fixes: e6644c967d3c ("rseq/selftests: Ensure the rseq ABI TLS is actually 1024 bytes")
Reported-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lore.kernel.org/r/20250319202144.1141542-1-mjeanson@efficios.com

authored by

Michael Jeanson and committed by
Ingo Molnar
d047e32b 34929a07

+2 -2
+2 -2
tools/testing/selftests/rseq/rseq.c
··· 75 75 * Use a union to ensure we allocate a TLS area of 1024 bytes to accomodate an 76 76 * rseq registration that is larger than the current rseq ABI. 77 77 */ 78 - union rseq { 78 + union rseq_tls { 79 79 struct rseq_abi abi; 80 80 char dummy[RSEQ_THREAD_AREA_ALLOC_SIZE]; 81 81 }; 82 82 83 83 static 84 - __thread union rseq __rseq __attribute__((tls_model("initial-exec"))) = { 84 + __thread union rseq_tls __rseq __attribute__((tls_model("initial-exec"))) = { 85 85 .abi = { 86 86 .cpu_id = RSEQ_ABI_CPU_ID_UNINITIALIZED, 87 87 },