Skip to content

Commit 13dbd83

Browse files
Chenghao Duanmetan-ucw
authored andcommitted
kallsyms: Add the capture of the SIGBUS signal
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 <[email protected]> Reviewed-by: Cyril Hrubis <[email protected]>
1 parent 1314816 commit 13dbd83

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

testcases/kernel/security/kallsyms/kallsyms.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ static int ranges_size, ranges_len;
6262

6363
static void segv_handler(int sig)
6464
{
65-
if (sig == SIGSEGV)
65+
if (sig == SIGSEGV || sig == SIGBUS)
6666
segv_caught++;
6767
else
6868
tst_res(TFAIL, "Unexpected signal %s", strsignal(sig));
@@ -143,6 +143,7 @@ static void setup(void)
143143
memset(&sa, 0, sizeof(sa));
144144
sa.sa_handler = segv_handler;
145145
sigaction(SIGSEGV, &sa, NULL);
146+
sigaction(SIGBUS, &sa, NULL);
146147

147148
nr_symbols = read_kallsyms(NULL, 0);
148149
sym_table = SAFE_CALLOC(nr_symbols, sizeof(*sym_table));

0 commit comments

Comments
 (0)