Re: [PATCH v1 0/2] Fix the failure issue of the module_attach test case

From: Chenghao Duan
Date: Wed Dec 10 2025 - 01:09:21 EST


On Wed, Dec 10, 2025 at 12:10:46PM +0800, Hengqi Chen wrote:
> One minor question, I wonder how you debug these issues ?
>

There were initially two issues:
1. When monitoring the function addresses of kernel modules in the
module_attach test case, kernel panic would occur.
2. Illegal address access in the module_attach and subprogs_extable
test cases would lead to kernel panic.

These two issues were debugged by combining different methods for
different scenarios, including gdb, kgdb, embedding break instructions
in assembly code, and printing stack and register data.

Chenghao
> On Tue, Dec 9, 2025 at 5:34 PM Chenghao Duan <duanchenghao@xxxxxxxxxx> wrote:
> >
> > The following test cases under the tools/testing/selftests/bpf/
> > directory have passed the test:
> >
> > ./test_progs -t module_attach
> > ./test_progs -t module_fentry_shadow
> > ./test_progs -t subprogs
> > ./test_progs -t subprogs_extable
> > ./test_progs -t tailcalls
> > ./test_progs -t struct_ops -d struct_ops_multi_pages
> > ./test_progs -t fexit_bpf2bpf
> > ./test_progs -t fexit_stress
> > ./test_progs -t module_fentry_shadow
> > ./test_progs -t fentry_test/fentry
> > ./test_progs -t fexit_test/fexit
> > ./test_progs -t fentry_fexit
> > ./test_progs -t modify_return
> > ./test_progs -t fexit_sleep
> > ./test_progs -t test_overhead
> > ./test_progs -t trampoline_count
> >
> > Chenghao Duan (2):
> > LoongArch: Modify the jump logic of the trampoline
> > LoongArch: BPF: Enable BPF exception fixup for specific ADE subcode
> >
> > arch/loongarch/kernel/mcount_dyn.S | 14 +++++---
> > arch/loongarch/kernel/traps.c | 7 +++-
> > arch/loongarch/net/bpf_jit.c | 37 +++++++++++++++------
> > samples/ftrace/ftrace-direct-modify.c | 8 ++---
> > samples/ftrace/ftrace-direct-multi-modify.c | 8 ++---
> > samples/ftrace/ftrace-direct-multi.c | 4 +--
> > samples/ftrace/ftrace-direct-too.c | 4 +--
> > samples/ftrace/ftrace-direct.c | 4 +--
> > 8 files changed, 56 insertions(+), 30 deletions(-)
> >
> > --
> > 2.25.1
> >