[v5.15] WARNING in bpf_probe_read_compat

6 views
Skip to first unread message

syzbot

unread,
Nov 2, 2023, 7:51:29 PM11/2/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 12952a23a5da Linux 5.15.137
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1531f59b680000
kernel config: https://syzkaller.appspot.com/x/.config?x=fec74236cf840914
dashboard link: https://syzkaller.appspot.com/bug?extid=c8d08ea57cf6eedbc51c
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/7e2dc2318d41/disk-12952a23.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/753b1c98a896/vmlinux-12952a23.xz
kernel image: https://storage.googleapis.com/syzbot-assets/2ed1ab0d1e32/bzImage-12952a23.xz

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

------------[ cut here ]------------
WARNING: CPU: 0 PID: 2963 at mm/maccess.c:226 copy_from_user_nofault+0x15c/0x1c0
Modules linked in:
CPU: 0 PID: 2963 Comm: udevd Not tainted 5.15.137-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
RIP: 0010:copy_from_user_nofault+0x15c/0x1c0 mm/maccess.c:226
Code: db 48 c7 c0 f2 ff ff ff 48 0f 44 c5 eb 0c e8 2b e7 d5 ff 48 c7 c0 f2 ff ff ff 5b 41 5c 41 5d 41 5e 41 5f 5d c3 e8 14 e7 d5 ff <0f> 0b e9 1e ff ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c ef fe ff
RSP: 0018:ffffc90000007ec8 EFLAGS: 00010046
RAX: ffffffff81aa3b3c RBX: 0000000000000000 RCX: ffff88807d120000
RDX: 0000000080010001 RSI: 0000000000000000 RDI: 0000000000000000
RBP: dffffc0000000000 R08: ffffffff81aa3a4d R09: ffffed100fa24001
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: 0000000000000005 R14: 0000000000000000 R15: ffffc90000007f40
FS: 00007f8182436c80(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fa4e16506be CR3: 000000001d699000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000600
Call Trace:
<IRQ>
bpf_probe_read_user_common kernel/trace/bpf_trace.c:157 [inline]
____bpf_probe_read_compat kernel/trace/bpf_trace.c:281 [inline]
bpf_probe_read_compat+0xe4/0x180 kernel/trace/bpf_trace.c:277
bpf_prog_eaa6c3274495767e+0x35/0xbc8
bpf_dispatcher_nop_func include/linux/bpf.h:776 [inline]
__bpf_prog_run include/linux/filter.h:618 [inline]
bpf_prog_run include/linux/filter.h:632 [inline]
__bpf_prog_test_run_raw_tp+0x225/0x2c0 net/bpf/test_run.c:331
flush_smp_call_function_queue+0x2b5/0x760 kernel/smp.c:628
__sysvec_call_function_single+0x9a/0x250 arch/x86/kernel/smp.c:248
sysvec_call_function_single+0x89/0xb0 arch/x86/kernel/smp.c:243
</IRQ>
<TASK>
asm_sysvec_call_function_single+0x16/0x20 arch/x86/include/asm/idtentry.h:646
RIP: 0010:memset_erms+0xb/0x10 arch/x86/lib/memset_64.S:65
Code: 03 40 0f b6 f6 48 b8 01 01 01 01 01 01 01 01 48 0f af c6 f3 48 ab 89 d1 f3 aa 4c 89 c8 c3 90 49 89 f9 40 88 f0 48 89 d1 f3 aa <4c> 89 c8 c3 90 49 89 fa 40 0f b6 ce 48 b8 01 01 01 01 01 01 01 01
RSP: 0018:ffffc90002bcf420 EFLAGS: 00000202
RAX: 0000000000000000 RBX: ffffc90002bcf530 RCX: 0000000000000000
RDX: 0000000000000010 RSI: 0000000000000000 RDI: ffffc90002bcf540
RBP: ffffffff8e811c12 R08: dffffc0000000000 R09: ffffc90002bcf530
R10: 0000000000000000 R11: dffffc0000000001 R12: 1ffffffff1d02382
R13: 1ffffffff1d02382 R14: ffffffff8e811c0e R15: ffffc90002bcf4e0
unwind_next_frame+0xbc8/0x1fa0 arch/x86/kernel/unwind_orc.c:547
arch_stack_walk+0x10d/0x140 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0x113/0x1c0 kernel/stacktrace.c:122
kasan_save_stack mm/kasan/common.c:38 [inline]
kasan_set_track mm/kasan/common.c:46 [inline]
set_alloc_info mm/kasan/common.c:434 [inline]
____kasan_kmalloc+0xba/0xf0 mm/kasan/common.c:513
kasan_kmalloc include/linux/kasan.h:264 [inline]
__kmalloc+0x168/0x300 mm/slub.c:4407
kmalloc include/linux/slab.h:596 [inline]
kzalloc include/linux/slab.h:721 [inline]
tomoyo_encode2 security/tomoyo/realpath.c:45 [inline]
tomoyo_encode+0x26b/0x530 security/tomoyo/realpath.c:80
tomoyo_realpath_from_path+0x5a2/0x5e0 security/tomoyo/realpath.c:288
tomoyo_get_realpath security/tomoyo/file.c:151 [inline]
tomoyo_path_perm+0x273/0x6b0 security/tomoyo/file.c:822
security_inode_getattr+0xcf/0x120 security/security.c:1348
vfs_getattr+0x26/0x360 fs/stat.c:157
vfs_statx+0x18f/0x3b0 fs/stat.c:225
vfs_fstatat fs/stat.c:243 [inline]
__do_sys_newfstatat fs/stat.c:411 [inline]
__se_sys_newfstatat fs/stat.c:405 [inline]
__x64_sys_newfstatat+0x12c/0x1b0 fs/stat.c:405
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f81825615f4
Code: 64 c7 00 09 00 00 00 83 c8 ff c3 48 89 f2 b9 00 01 00 00 48 89 fe bf 9c ff ff ff e9 00 00 00 00 41 89 ca b8 06 01 00 00 0f 05 <45> 31 c0 3d 00 f0 ff ff 76 10 48 8b 15 03 a8 0d 00 f7 d8 41 83 c8
RSP: 002b:00007ffe18e16c78 EFLAGS: 00000206 ORIG_RAX: 0000000000000106
RAX: ffffffffffffffda RBX: 00007f8182639460 RCX: 00007f81825615f4
RDX: 00007ffe18e16c80 RSI: 00007f81825fe130 RDI: 000000000000000c
RBP: 000055e55a3d74b0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000001000 R11: 0000000000000206 R12: 0000000000000000
R13: 0000000000003fff R14: 00007ffe18e17218 R15: 000000000000000a
</TASK>
----------------
Code disassembly (best guess):
0: 03 40 0f add 0xf(%rax),%eax
3: b6 f6 mov $0xf6,%dh
5: 48 b8 01 01 01 01 01 movabs $0x101010101010101,%rax
c: 01 01 01
f: 48 0f af c6 imul %rsi,%rax
13: f3 48 ab rep stos %rax,%es:(%rdi)
16: 89 d1 mov %edx,%ecx
18: f3 aa rep stos %al,%es:(%rdi)
1a: 4c 89 c8 mov %r9,%rax
1d: c3 ret
1e: 90 nop
1f: 49 89 f9 mov %rdi,%r9
22: 40 88 f0 mov %sil,%al
25: 48 89 d1 mov %rdx,%rcx
28: f3 aa rep stos %al,%es:(%rdi)
* 2a: 4c 89 c8 mov %r9,%rax <-- trapping instruction
2d: c3 ret
2e: 90 nop
2f: 49 89 fa mov %rdi,%r10
32: 40 0f b6 ce movzbl %sil,%ecx
36: 48 b8 01 01 01 01 01 movabs $0x101010101010101,%rax
3d: 01 01 01


---
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,
Nov 2, 2023, 8:11:25 PM11/2/23
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 12952a23a5da Linux 5.15.137
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=1741d74f680000
kernel config: https://syzkaller.appspot.com/x/.config?x=fec74236cf840914
dashboard link: https://syzkaller.appspot.com/bug?extid=c8d08ea57cf6eedbc51c
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=14b555d3680000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=166c7d07680000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/7e2dc2318d41/disk-12952a23.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/753b1c98a896/vmlinux-12952a23.xz
kernel image: https://storage.googleapis.com/syzbot-assets/2ed1ab0d1e32/bzImage-12952a23.xz

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

------------[ cut here ]------------
WARNING: CPU: 0 PID: 3502 at mm/maccess.c:226 copy_from_user_nofault+0x15c/0x1c0
Modules linked in:
CPU: 0 PID: 3502 Comm: udevd Not tainted 5.15.137-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
RIP: 0010:copy_from_user_nofault+0x15c/0x1c0 mm/maccess.c:226
Code: db 48 c7 c0 f2 ff ff ff 48 0f 44 c5 eb 0c e8 2b e7 d5 ff 48 c7 c0 f2 ff ff ff 5b 41 5c 41 5d 41 5e 41 5f 5d c3 e8 14 e7 d5 ff <0f> 0b e9 1e ff ff ff 89 d9 80 e1 07 80 c1 03 38 c1 0f 8c ef fe ff
RSP: 0018:ffffc90000007ec8 EFLAGS: 00010046
RAX: ffffffff81aa3b3c RBX: 0000000000000000 RCX: ffff88802242bb80
RDX: 0000000080010001 RSI: 0000000000000000 RDI: 0000000000000000
RBP: dffffc0000000000 R08: ffffffff81aa3a4d R09: ffffed1004485771
R10: 0000000000000000 R11: dffffc0000000001 R12: 0000000000000000
R13: 0000000000000005 R14: 0000000000000000 R15: ffffc90000007f40
FS: 00007f99762c6c80(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000557d17898000 CR3: 000000001e3a8000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<IRQ>
bpf_probe_read_user_common kernel/trace/bpf_trace.c:157 [inline]
____bpf_probe_read_compat kernel/trace/bpf_trace.c:281 [inline]
bpf_probe_read_compat+0xe4/0x180 kernel/trace/bpf_trace.c:277
bpf_prog_eaa6c3274495767e+0x35/0x134
bpf_dispatcher_nop_func include/linux/bpf.h:776 [inline]
__bpf_prog_run include/linux/filter.h:625 [inline]
bpf_prog_run include/linux/filter.h:632 [inline]
__bpf_prog_test_run_raw_tp+0x122/0x2c0 net/bpf/test_run.c:331
flush_smp_call_function_queue+0x2b5/0x760 kernel/smp.c:628
__sysvec_call_function_single+0x9a/0x250 arch/x86/kernel/smp.c:248
sysvec_call_function_single+0x89/0xb0 arch/x86/kernel/smp.c:243
</IRQ>
<TASK>
asm_sysvec_call_function_single+0x16/0x20 arch/x86/include/asm/idtentry.h:646
RIP: 0010:finish_lock_switch+0x91/0x100 kernel/sched/core.c:4781
Code: 45 31 c9 68 57 62 59 81 e8 0c 1a 09 00 48 83 c4 08 4c 89 ff e8 b0 da fe ff 66 90 4c 89 ff e8 e6 85 cb 08 e8 01 41 2d 00 fb 5b <41> 5c 41 5d 41 5e 41 5f c3 44 89 f1 80 e1 07 80 c1 03 38 c1 7c 87
RSP: 0018:ffffc90002c1f2b8 EFLAGS: 00000282
RAX: 1cac8fd8db165500 RBX: ffff888022719df4 RCX: ffffffff913c5003
RDX: dffffc0000000000 RSI: ffffffff8a8b0be0 RDI: ffffffff8ad87b40
RBP: ffffc90002c1f330 R08: ffffffff8186a3c0 R09: ffffed10173472e1
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: 1ffff1101734748b R14: ffff8880b9a3a458 R15: ffff8880b9a39700
finish_task_switch+0x134/0x630 kernel/sched/core.c:4898
context_switch kernel/sched/core.c:5029 [inline]
__schedule+0x12cc/0x45b0 kernel/sched/core.c:6372
preempt_schedule_common+0x83/0xd0 kernel/sched/core.c:6548
preempt_schedule+0xd9/0xe0 kernel/sched/core.c:6573
preempt_schedule_thunk+0x16/0x18 arch/x86/entry/thunk_64.S:34
__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline]
_raw_spin_unlock_irqrestore+0x128/0x130 kernel/locking/spinlock.c:194
spin_unlock_irqrestore include/linux/spinlock.h:418 [inline]
__wake_up_common_lock kernel/sched/wait.c:140 [inline]
__wake_up_sync_key+0x121/0x1c0 kernel/sched/wait.c:205
sock_def_readable+0x135/0x240 net/core/sock.c:3073
__netlink_sendskb net/netlink/af_netlink.c:1277 [inline]
netlink_broadcast_deliver net/netlink/af_netlink.c:1409 [inline]
do_one_broadcast net/netlink/af_netlink.c:1494 [inline]
netlink_broadcast_filtered+0xc60/0x11a0 net/netlink/af_netlink.c:1538
netlink_broadcast net/netlink/af_netlink.c:1562 [inline]
netlink_sendmsg+0x8f9/0xd60 net/netlink/af_netlink.c:1922
sock_sendmsg_nosec net/socket.c:704 [inline]
__sock_sendmsg net/socket.c:716 [inline]
____sys_sendmsg+0x59e/0x8f0 net/socket.c:2429
___sys_sendmsg+0x252/0x2e0 net/socket.c:2483
__sys_sendmsg net/socket.c:2512 [inline]
__do_sys_sendmsg net/socket.c:2521 [inline]
__se_sys_sendmsg+0x19a/0x260 net/socket.c:2519
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x61/0xcb
RIP: 0033:0x7f99763ffa4b
Code: ff 89 ef 48 89 04 24 e8 22 56 f9 ff 48 8b 04 24 48 83 c4 20 5d c3 c3 64 8b 04 25 18 00 00 00 85 c0 75 20 b8 2e 00 00 00 0f 05 <48> 3d 00 f0 ff ff 76 6d 48 8b 15 ae c3 0c 00 f7 d8 64 89 02 48 83
RSP: 002b:00007ffda16266b8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 0000556677e63e20 RCX: 00007f99763ffa4b
RDX: 0000000000000000 RSI: 00007ffda16266c8 RDI: 000000000000000c
RBP: 0000000000000000 R08: 0000000000000001 R09: a8dbfa0e89104cc4
R10: 1999999999999999 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000008f R14: 0000000000000000 R15: 0000556677e3d910
</TASK>
----------------
Code disassembly (best guess):
0: 45 31 c9 xor %r9d,%r9d
3: 68 57 62 59 81 push $0xffffffff81596257
8: e8 0c 1a 09 00 call 0x91a19
d: 48 83 c4 08 add $0x8,%rsp
11: 4c 89 ff mov %r15,%rdi
14: e8 b0 da fe ff call 0xfffedac9
19: 66 90 xchg %ax,%ax
1b: 4c 89 ff mov %r15,%rdi
1e: e8 e6 85 cb 08 call 0x8cb8609
23: e8 01 41 2d 00 call 0x2d4129
28: fb sti
29: 5b pop %rbx
* 2a: 41 5c pop %r12 <-- trapping instruction
2c: 41 5d pop %r13
2e: 41 5e pop %r14
30: 41 5f pop %r15
32: c3 ret
33: 44 89 f1 mov %r14d,%ecx
36: 80 e1 07 and $0x7,%cl
39: 80 c1 03 add $0x3,%cl
3c: 38 c1 cmp %al,%cl
3e: 7c 87 jl 0xffffffc7


---
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,
Nov 4, 2023, 1:19:07 AM11/4/23
to syzkaller...@googlegroups.com
syzbot suspects this issue could be fixed by backporting the following commit:

commit d319f344561de23e810515d109c7278919bff7b0
git tree: upstream
Author: Alexei Starovoitov <a...@kernel.org>
Date: Mon Apr 10 17:43:44 2023 +0000

mm: Fix copy_from_user_nofault().

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

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages