[v5.15] WARNING in bpf_get_stack_raw_tp

0 views
Skip to first unread message

syzbot

unread,
Aug 19, 2024, 9:02:30 AM8/19/24
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: fa93fa65db6e Linux 5.15.165
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=12a50d83980000
kernel config: https://syzkaller.appspot.com/x/.config?x=d027d7ba4e9e9586
dashboard link: https://syzkaller.appspot.com/bug?extid=0ccbce2f3e87c167eccb
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/1aa5634d3ab8/disk-fa93fa65.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e9ed6b8376d3/vmlinux-fa93fa65.xz
kernel image: https://storage.googleapis.com/syzbot-assets/03059c6a446f/bzImage-fa93fa65.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+0ccbce...@syzkaller.appspotmail.com

------------[ cut here ]------------
WARNING: CPU: 1 PID: 6940 at kernel/trace/bpf_trace.c:1411 ____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1483 [inline]
WARNING: CPU: 1 PID: 6940 at kernel/trace/bpf_trace.c:1411 bpf_get_stack_raw_tp+0x1d3/0x220 kernel/trace/bpf_trace.c:1480
Modules linked in:
CPU: 1 PID: 6940 Comm: syz.3.871 Not tainted 5.15.165-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
RIP: 0010:get_bpf_raw_tp_regs kernel/trace/bpf_trace.c:1411 [inline]
RIP: 0010:____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1483 [inline]
RIP: 0010:bpf_get_stack_raw_tp+0x1d3/0x220 kernel/trace/bpf_trace.c:1480
Code: f1 45 31 c0 e8 4e 96 14 00 65 ff 0d 6f de 78 7e 4c 63 e8 4c 89 e8 48 83 c4 18 5b 41 5c 41 5d 41 5e 41 5f 5d c3 e8 cd 02 f6 ff <0f> 0b 65 ff 0d 4c de 78 7e 49 c7 c5 f0 ff ff ff eb d7 e8 b6 02 f6
RSP: 0018:ffffc900030065b0 EFLAGS: 00010083
RAX: ffffffff818a5ed3 RBX: 0000000000000003 RCX: 0000000000040000
RDX: ffffc90004cf1000 RSI: 0000000000005a91 RDI: 0000000000005a92
RBP: ffffc900030065f0 R08: ffffffff818a5d93 R09: fffffbfff1f8e219
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc90003006608
R13: 0000000000000000 R14: 0000000000000900 R15: ffff8880b9b33b30
FS: 00007f3b1d0226c0(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000000110c332495 CR3: 0000000011c63000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600
Call Trace:
<TASK>
bpf_prog_ec3b2eefa702d8d3+0x3a/0xb98
bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline]
bpf_trace_run4+0x1ea/0x390 kernel/trace/bpf_trace.c:1919
trace_mmap_lock_acquire_returned include/trace/events/mmap_lock.h:44 [inline]
__mmap_lock_do_trace_acquire_returned+0x24d/0x2c0 mm/mmap_lock.c:102
__mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline]
mmap_read_trylock include/linux/mmap_lock.h:137 [inline]
stack_map_get_build_id_offset+0x612/0x930 kernel/bpf/stackmap.c:185
__bpf_get_stack+0x495/0x570 kernel/bpf/stackmap.c:496
____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1490 [inline]
bpf_get_stack_raw_tp+0x1b2/0x220 kernel/trace/bpf_trace.c:1480
bpf_prog_ec3b2eefa702d8d3+0x3a/0xb98
bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline]
bpf_trace_run4+0x1ea/0x390 kernel/trace/bpf_trace.c:1919
trace_mmap_lock_acquire_returned include/trace/events/mmap_lock.h:44 [inline]
__mmap_lock_do_trace_acquire_returned+0x24d/0x2c0 mm/mmap_lock.c:102
__mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline]
mmap_read_trylock include/linux/mmap_lock.h:137 [inline]
stack_map_get_build_id_offset+0x612/0x930 kernel/bpf/stackmap.c:185
__bpf_get_stack+0x495/0x570 kernel/bpf/stackmap.c:496
____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1490 [inline]
bpf_get_stack_raw_tp+0x1b2/0x220 kernel/trace/bpf_trace.c:1480
bpf_prog_ec3b2eefa702d8d3+0x3a/0xb98
bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline]
bpf_trace_run4+0x1ea/0x390 kernel/trace/bpf_trace.c:1919
trace_mmap_lock_acquire_returned include/trace/events/mmap_lock.h:44 [inline]
__mmap_lock_do_trace_acquire_returned+0x24d/0x2c0 mm/mmap_lock.c:102
__mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline]
mmap_read_trylock include/linux/mmap_lock.h:137 [inline]
stack_map_get_build_id_offset+0x612/0x930 kernel/bpf/stackmap.c:185
__bpf_get_stack+0x495/0x570 kernel/bpf/stackmap.c:496
____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1490 [inline]
bpf_get_stack_raw_tp+0x1b2/0x220 kernel/trace/bpf_trace.c:1480
bpf_prog_ec3b2eefa702d8d3+0x3a/0xb98
bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline]
bpf_trace_run2+0x19e/0x340 kernel/trace/bpf_trace.c:1917
trace_tlb_flush+0xed/0x110 include/trace/events/tlb.h:38
switch_mm_irqs_off+0x748/0xa30
use_temporary_mm arch/x86/kernel/alternative.c:1019 [inline]
__text_poke+0x5b8/0x9e0 arch/x86/kernel/alternative.c:1116
text_poke arch/x86/kernel/alternative.c:1178 [inline]
text_poke_bp_batch+0x14c/0x930 arch/x86/kernel/alternative.c:1404
text_poke_flush arch/x86/kernel/alternative.c:1598 [inline]
text_poke_finish+0x16/0x30 arch/x86/kernel/alternative.c:1605
arch_jump_label_transform_apply+0x13/0x20 arch/x86/kernel/jump_label.c:146
static_key_enable_cpuslocked+0x12e/0x250 kernel/jump_label.c:177
static_key_enable+0x16/0x20 kernel/jump_label.c:190
tracepoint_add_func+0x947/0x9d0 kernel/tracepoint.c:361
tracepoint_probe_register_prio_may_exist+0x11e/0x190 kernel/tracepoint.c:482
bpf_raw_tracepoint_open+0x65a/0x750 kernel/bpf/syscall.c:3113
__sys_bpf+0x468/0x670 kernel/bpf/syscall.c:4693
__do_sys_bpf kernel/bpf/syscall.c:4755 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4753 [inline]
__x64_sys_bpf+0x78/0x90 kernel/bpf/syscall.c:4753
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x66/0xd0
RIP: 0033:0x7f3b1eba5e79
Code: Unable to access opcode bytes at RIP 0x7f3b1eba5e4f.
RSP: 002b:00007f3b1d022038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f3b1ed41f80 RCX: 00007f3b1eba5e79
RDX: 0000000000000010 RSI: 0000000020000340 RDI: 0000000000000011
RBP: 00007f3b1ec13916 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f3b1ed41f80 R15: 00007ffe9961fa88
</TASK>


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Aug 19, 2024, 10:29:31 AM8/19/24
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: fa93fa65db6e Linux 5.15.165
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=14dc2dd3980000
kernel config: https://syzkaller.appspot.com/x/.config?x=d027d7ba4e9e9586
dashboard link: https://syzkaller.appspot.com/bug?extid=0ccbce2f3e87c167eccb
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11bb69f5980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=15e6d98d980000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/1aa5634d3ab8/disk-fa93fa65.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/e9ed6b8376d3/vmlinux-fa93fa65.xz
kernel image: https://storage.googleapis.com/syzbot-assets/03059c6a446f/bzImage-fa93fa65.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+0ccbce...@syzkaller.appspotmail.com

------------[ cut here ]------------
WARNING: CPU: 1 PID: 3565 at kernel/trace/bpf_trace.c:1411 ____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1483 [inline]
WARNING: CPU: 1 PID: 3565 at kernel/trace/bpf_trace.c:1411 bpf_get_stack_raw_tp+0x1d3/0x220 kernel/trace/bpf_trace.c:1480
Modules linked in:
CPU: 1 PID: 3565 Comm: syz-executor333 Not tainted 5.15.165-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
RIP: 0010:get_bpf_raw_tp_regs kernel/trace/bpf_trace.c:1411 [inline]
RIP: 0010:____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1483 [inline]
RIP: 0010:bpf_get_stack_raw_tp+0x1d3/0x220 kernel/trace/bpf_trace.c:1480
Code: f1 45 31 c0 e8 4e 96 14 00 65 ff 0d 6f de 78 7e 4c 63 e8 4c 89 e8 48 83 c4 18 5b 41 5c 41 5d 41 5e 41 5f 5d c3 e8 cd 02 f6 ff <0f> 0b 65 ff 0d 4c de 78 7e 49 c7 c5 f0 ff ff ff eb d7 e8 b6 02 f6
RSP: 0000:ffffc900010debf0 EFLAGS: 00010293
RAX: ffffffff818a5ed3 RBX: 0000000000000003 RCX: ffff8880167fbb80
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000fffffffc
RBP: ffffc900010dec30 R08: ffffffff818a5d93 R09: fffffbfff1f8e219
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffc900010dec48
R13: 0000000000000000 R14: 0000000000000900 R15: ffff8880b9b33b30
FS: 00005555560f4380(0000) GS:ffff8880b9b00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fbf11bdbce8 CR3: 000000001ffde000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
bpf_prog_ec3b2eefa702d8d3+0x3a/0x56c
bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline]
bpf_trace_run4+0x1ea/0x390 kernel/trace/bpf_trace.c:1919
trace_mmap_lock_acquire_returned include/trace/events/mmap_lock.h:44 [inline]
__mmap_lock_do_trace_acquire_returned+0x24d/0x2c0 mm/mmap_lock.c:102
__mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline]
mmap_read_trylock include/linux/mmap_lock.h:137 [inline]
stack_map_get_build_id_offset+0x612/0x930 kernel/bpf/stackmap.c:185
__bpf_get_stack+0x495/0x570 kernel/bpf/stackmap.c:496
____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1490 [inline]
bpf_get_stack_raw_tp+0x1b2/0x220 kernel/trace/bpf_trace.c:1480
bpf_prog_ec3b2eefa702d8d3+0x3a/0x56c
bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline]
bpf_trace_run4+0x1ea/0x390 kernel/trace/bpf_trace.c:1919
trace_mmap_lock_acquire_returned include/trace/events/mmap_lock.h:44 [inline]
__mmap_lock_do_trace_acquire_returned+0x24d/0x2c0 mm/mmap_lock.c:102
__mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline]
mmap_read_trylock include/linux/mmap_lock.h:137 [inline]
stack_map_get_build_id_offset+0x612/0x930 kernel/bpf/stackmap.c:185
__bpf_get_stack+0x495/0x570 kernel/bpf/stackmap.c:496
____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1490 [inline]
bpf_get_stack_raw_tp+0x1b2/0x220 kernel/trace/bpf_trace.c:1480
bpf_prog_ec3b2eefa702d8d3+0x3a/0x56c
bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline]
bpf_trace_run4+0x1ea/0x390 kernel/trace/bpf_trace.c:1919
trace_mmap_lock_acquire_returned include/trace/events/mmap_lock.h:44 [inline]
__mmap_lock_do_trace_acquire_returned+0x24d/0x2c0 mm/mmap_lock.c:102
__mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline]
mmap_read_trylock include/linux/mmap_lock.h:137 [inline]
stack_map_get_build_id_offset+0x612/0x930 kernel/bpf/stackmap.c:185
__bpf_get_stack+0x495/0x570 kernel/bpf/stackmap.c:496
____bpf_get_stack_raw_tp kernel/trace/bpf_trace.c:1490 [inline]
bpf_get_stack_raw_tp+0x1b2/0x220 kernel/trace/bpf_trace.c:1480
bpf_prog_ec3b2eefa702d8d3+0x3a/0x56c
bpf_dispatcher_nop_func include/linux/bpf.h:790 [inline]
__bpf_prog_run include/linux/filter.h:628 [inline]
bpf_prog_run include/linux/filter.h:635 [inline]
__bpf_trace_run kernel/trace/bpf_trace.c:1880 [inline]
bpf_trace_run4+0x1ea/0x390 kernel/trace/bpf_trace.c:1919
trace_mmap_lock_acquire_returned include/trace/events/mmap_lock.h:44 [inline]
__mmap_lock_do_trace_acquire_returned+0x24d/0x2c0 mm/mmap_lock.c:102
__mmap_lock_trace_acquire_returned include/linux/mmap_lock.h:36 [inline]
mmap_read_trylock include/linux/mmap_lock.h:137 [inline]
do_user_addr_fault arch/x86/mm/fault.c:1298 [inline]
handle_page_fault arch/x86/mm/fault.c:1445 [inline]
exc_page_fault+0x564/0x700 arch/x86/mm/fault.c:1501
asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:568
RIP: 0033:0x7fbf11b380d0
Code: 41 54 55 48 89 f5 53 89 fb 48 83 ec 18 48 83 3d 1d 0f 0a 00 00 89 54 24 0c 74 08 84 c9 0f 85 09 02 00 00 31 c0 ba 01 00 00 00 <f0> 0f b1 15 10 3c 0a 00 0f 85 0f 02 00 00 4c 8d 25 03 3c 0a 00 4c
RSP: 002b:00007ffd547ff680 EFLAGS: 00010246
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000001
RDX: 0000000000000001 RSI: 00007fbf11bd9118 RDI: 0000000000000000
RBP: 00007fbf11bd9118 R08: 0000000000000006 R09: 0000000000000006
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000001
</TASK>


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

syzbot

unread,
Sep 4, 2024, 1:43:04 AM9/4/24
to syzkaller...@googlegroups.com
syzbot suspects this issue could be fixed by backporting the following commit:

commit 7d6be67cfdd4a53cea7147313ca13c531e3a470f
git tree: upstream
Author: Tetsuo Handa <penguin...@I-love.SAKURA.ne.jp>
Date: Fri Jun 21 01:08:41 2024 +0000

mm: mmap_lock: replace get_memcg_path_buf() with on-stack buffer

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=12bf9267980000
Please keep in mind that other backports might be required as well.

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

syzbot

unread,
Sep 4, 2024, 3:09:03 AM9/4/24
to syzkaller...@googlegroups.com
The commit that was suspected to fix the issue was backported to the fuzzed
kernel trees.

commit d240b789dded28e4fb9f28b4265dbaf67050d870
Author: <penguin...@I-love.SAKURA.ne.jp>
Date: Fri Jun 21 01:08:41 2024 +0000

mm: mmap_lock: replace get_memcg_path_buf() with on-stack buffer

If you believe this is correct, please reply with
#syz fix: mm: mmap_lock: replace get_memcg_path_buf() with on-stack buffer

The commit was initially detected here:

commit 7d6be67cfdd4a53cea7147313ca13c531e3a470f
git tree: upstream
Author: Tetsuo Handa <penguin...@I-love.SAKURA.ne.jp>
Date: Fri Jun 21 01:08:41 2024 +0000

mm: mmap_lock: replace get_memcg_path_buf() with on-stack buffer

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=12bf9267980000

syzbot

unread,
Sep 3, 2025, 11:28:21 PM (4 days ago) Sep 3
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
No recent activity, existing reproducers are no longer triggering the issue.
Reply all
Reply to author
Forward
0 new messages