* [LTP] [PATCH] kallsyms: Add the capture of the SIGBUS signal
@ 2025-11-26 3:10 Chenghao Duan
2025-11-26 12:11 ` Cyril Hrubis
0 siblings, 1 reply; 2+ messages in thread
From: Chenghao Duan @ 2025-11-26 3:10 UTC (permalink / raw)
To: ltp
When user-space accesses a kernel virtual address on the LoongArch
architecture, a ade(address error) exception is generated, and the
SIGBUS signal is returned to user-space within the exception handler.
Signed-off-by: Chenghao Duan <duanchenghao@kylinos.cn>
---
testcases/kernel/security/kallsyms/kallsyms.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/testcases/kernel/security/kallsyms/kallsyms.c b/testcases/kernel/security/kallsyms/kallsyms.c
index 45b3e18d4..6a970f8c8 100644
--- a/testcases/kernel/security/kallsyms/kallsyms.c
+++ b/testcases/kernel/security/kallsyms/kallsyms.c
@@ -62,7 +62,7 @@ static int ranges_size, ranges_len;
static void segv_handler(int sig)
{
- if (sig == SIGSEGV)
+ if (sig == SIGSEGV || sig == SIGBUS)
segv_caught++;
else
tst_res(TFAIL, "Unexpected signal %s", strsignal(sig));
@@ -143,6 +143,7 @@ static void setup(void)
memset(&sa, 0, sizeof(sa));
sa.sa_handler = segv_handler;
sigaction(SIGSEGV, &sa, NULL);
+ sigaction(SIGBUS, &sa, NULL);
nr_symbols = read_kallsyms(NULL, 0);
sym_table = SAFE_CALLOC(nr_symbols, sizeof(*sym_table));
--
2.25.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [LTP] [PATCH] kallsyms: Add the capture of the SIGBUS signal
2025-11-26 3:10 [LTP] [PATCH] kallsyms: Add the capture of the SIGBUS signal Chenghao Duan
@ 2025-11-26 12:11 ` Cyril Hrubis
0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2025-11-26 12:11 UTC (permalink / raw)
To: Chenghao Duan; +Cc: ltp
Hi!
Applied, thanks.
--
Cyril Hrubis
chrubis@suse.cz
--
Mailing list info: https://lists.linux.it/listinfo/ltp
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-26 12:11 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-26 3:10 [LTP] [PATCH] kallsyms: Add the capture of the SIGBUS signal Chenghao Duan
2025-11-26 12:11 ` Cyril Hrubis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox