* [PATCH] kselftest/coredump: reintroduce null pointer dereference
@ 2026-03-20 19:46 Emanuele Rocca
2026-03-23 13:28 ` Mark Brown
2026-03-23 15:27 ` Christian Brauner
0 siblings, 2 replies; 3+ messages in thread
From: Emanuele Rocca @ 2026-03-20 19:46 UTC (permalink / raw)
To: linux-kernel
Cc: linux-kselftest, Clint George, Shuah Khan, Christian Brauner,
Mark Brown
Commit 673a55cc49da replaced the null pointer dereference used in
crashing_child() with __builtin_trap to address the following LLVM warnings:
coredump_test_helpers.c:59:6: warning: indirection of non-volatile null pointer will be deleted, not trap [-Wnull-dereference]
coredump_test_helpers.c:59:6: note: consider using __builtin_trap() or qualifying pointer with 'volatile'
All coredump tests expect crashing_child() to result in a SIGSEGV. However, the
behavior of __builtin_trap is architecture-dependent. On x86 it yields SIGILL,
on aarch64 SIGTRAP. Given that neither of those signals are SIGSEGV, both
coredump_socket_test and coredump_socket_protocol_test are currently failing:
get_pidfd_info: mask=0xd7, coredump_mask=0x5, coredump_signal=5
socket_coredump_signal_sigsegv: coredump_signal=5, expected SIGSEGV=11
Qualify the pointer with volatile instead of calling __builtin_trap to fix the
tests.
Signed-off-by: Emanuele Rocca <emanuele.rocca@arm.com>
---
tools/testing/selftests/coredump/coredump_test_helpers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/coredump/coredump_test_helpers.c b/tools/testing/selftests/coredump/coredump_test_helpers.c
index 5c8adee63641..2c850e0b1b57 100644
--- a/tools/testing/selftests/coredump/coredump_test_helpers.c
+++ b/tools/testing/selftests/coredump/coredump_test_helpers.c
@@ -56,7 +56,7 @@ void crashing_child(void)
pthread_create(&thread, NULL, do_nothing, NULL);
/* crash on purpose */
- __builtin_trap();
+ i = *(volatile int *)NULL;
}
int create_detached_tmpfs(void)
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] kselftest/coredump: reintroduce null pointer dereference
2026-03-20 19:46 [PATCH] kselftest/coredump: reintroduce null pointer dereference Emanuele Rocca
@ 2026-03-23 13:28 ` Mark Brown
2026-03-23 15:27 ` Christian Brauner
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2026-03-23 13:28 UTC (permalink / raw)
To: Emanuele Rocca
Cc: linux-kernel, linux-kselftest, Clint George, Shuah Khan,
Christian Brauner
[-- Attachment #1: Type: text/plain, Size: 581 bytes --]
On Fri, Mar 20, 2026 at 08:46:43PM +0100, Emanuele Rocca wrote:
> behavior of __builtin_trap is architecture-dependent. On x86 it yields SIGILL,
> on aarch64 SIGTRAP. Given that neither of those signals are SIGSEGV, both
> coredump_socket_test and coredump_socket_protocol_test are currently failing:
> get_pidfd_info: mask=0xd7, coredump_mask=0x5, coredump_signal=5
> socket_coredump_signal_sigsegv: coredump_signal=5, expected SIGSEGV=11
> Qualify the pointer with volatile instead of calling __builtin_trap to fix the
> tests.
Reviewed-by: Mark Brown <broonie@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] kselftest/coredump: reintroduce null pointer dereference
2026-03-20 19:46 [PATCH] kselftest/coredump: reintroduce null pointer dereference Emanuele Rocca
2026-03-23 13:28 ` Mark Brown
@ 2026-03-23 15:27 ` Christian Brauner
1 sibling, 0 replies; 3+ messages in thread
From: Christian Brauner @ 2026-03-23 15:27 UTC (permalink / raw)
To: linux-kernel, Emanuele Rocca
Cc: Christian Brauner, linux-kselftest, Clint George, Shuah Khan,
Mark Brown
On Fri, 20 Mar 2026 20:46:43 +0100, Emanuele Rocca wrote:
> Commit 673a55cc49da replaced the null pointer dereference used in
> crashing_child() with __builtin_trap to address the following LLVM warnings:
>
> coredump_test_helpers.c:59:6: warning: indirection of non-volatile null pointer will be deleted, not trap [-Wnull-dereference]
> coredump_test_helpers.c:59:6: note: consider using __builtin_trap() or qualifying pointer with 'volatile'
>
> All coredump tests expect crashing_child() to result in a SIGSEGV. However, the
> behavior of __builtin_trap is architecture-dependent. On x86 it yields SIGILL,
> on aarch64 SIGTRAP. Given that neither of those signals are SIGSEGV, both
> coredump_socket_test and coredump_socket_protocol_test are currently failing:
>
> [...]
Applied to the vfs-7.1.pidfs branch of the vfs/vfs.git tree.
Patches in the vfs-7.1.pidfs branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.1.pidfs
[1/1] kselftest/coredump: reintroduce null pointer dereference
https://git.kernel.org/vfs/vfs/c/3fc66a103395
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-23 15:28 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-20 19:46 [PATCH] kselftest/coredump: reintroduce null pointer dereference Emanuele Rocca
2026-03-23 13:28 ` Mark Brown
2026-03-23 15:27 ` Christian Brauner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox