[v5.15] kernel BUG in prog_array_map_poke_run

4 views
Skip to first unread message

syzbot

unread,
Nov 7, 2023, 6:42:23 AM11/7/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=13e3d0df680000
kernel config: https://syzkaller.appspot.com/x/.config?x=fec74236cf840914
dashboard link: https://syzkaller.appspot.com/bug?extid=ac89e36969de34892034
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=1774cd60e80000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17090097680000

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+ac89e3...@syzkaller.appspotmail.com

------------[ cut here ]------------
kernel BUG at kernel/bpf/arraymap.c:1037!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 24518 Comm: kworker/0:7 Not tainted 5.15.137-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
Workqueue: events prog_array_map_clear_deferred
RIP: 0010:prog_array_map_poke_run+0x65d/0x670 kernel/bpf/arraymap.c:1037
Code: d2 e7 ff 48 83 c4 68 5b 41 5c 41 5d 41 5e 41 5f 5d c3 e8 e6 d2 e7 ff 0f 0b e9 18 fa ff ff e8 da d2 e7 ff 0f 0b e8 d3 d2 e7 ff <0f> 0b e8 cc d2 e7 ff 0f 0b e8 c5 d2 e7 ff 0f 0b 0f 1f 00 55 48 89
RSP: 0018:ffffc900010ffab8 EFLAGS: 00010293
RAX: ffffffff81984f7d RBX: 00000000fffffff0 RCX: ffff88801ce70000
RDX: 0000000000000000 RSI: 00000000fffffff0 RDI: 00000000ffffffea
RBP: ffff888019797890 R08: ffffffff81984d20 R09: fffff5200021ff29
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: dffffc0000000000 R14: 0000000000000001 R15: ffff888012dab650
FS: 0000000000000000(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f67786e0d58 CR3: 000000000c68e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
fd_array_map_delete_elem+0x13c/0x230 kernel/bpf/arraymap.c:830
bpf_fd_array_map_clear kernel/bpf/arraymap.c:878 [inline]
prog_array_map_clear_deferred+0xfb/0x210 kernel/bpf/arraymap.c:1057
process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
kthread+0x3f6/0x4f0 kernel/kthread.c:319
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
</TASK>
Modules linked in:
---[ end trace a3b70ca8fdd511fb ]---
RIP: 0010:prog_array_map_poke_run+0x65d/0x670 kernel/bpf/arraymap.c:1037
Code: d2 e7 ff 48 83 c4 68 5b 41 5c 41 5d 41 5e 41 5f 5d c3 e8 e6 d2 e7 ff 0f 0b e9 18 fa ff ff e8 da d2 e7 ff 0f 0b e8 d3 d2 e7 ff <0f> 0b e8 cc d2 e7 ff 0f 0b e8 c5 d2 e7 ff 0f 0b 0f 1f 00 55 48 89
RSP: 0018:ffffc900010ffab8 EFLAGS: 00010293
RAX: ffffffff81984f7d RBX: 00000000fffffff0 RCX: ffff88801ce70000
RDX: 0000000000000000 RSI: 00000000fffffff0 RDI: 00000000ffffffea
RBP: ffff888019797890 R08: ffffffff81984d20 R09: fffff5200021ff29
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: dffffc0000000000 R14: 0000000000000001 R15: ffff888012dab650
FS: 0000000000000000(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f67786e0d58 CR3: 00000000230e5000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400


---
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 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.

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 7, 2023, 8:21:35 PM11/7/23
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 4a61839152cc Linux 6.1.61
git tree: linux-6.1.y
console output: https://syzkaller.appspot.com/x/log.txt?x=165b137f680000
kernel config: https://syzkaller.appspot.com/x/.config?x=a1472537c0348d87
dashboard link: https://syzkaller.appspot.com/bug?extid=8d05832106d723fa0f4e
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=13b6c787680000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11f970c0e80000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/6df94032b8cb/disk-4a618391.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/725f30ff8687/vmlinux-4a618391.xz
kernel image: https://storage.googleapis.com/syzbot-assets/a4a80d5123e7/bzImage-4a618391.xz

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

------------[ cut here ]------------
kernel BUG at kernel/bpf/arraymap.c:1077!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 7 Comm: kworker/0:0 Not tainted 6.1.61-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023
Workqueue: events prog_array_map_clear_deferred
RIP: 0010:prog_array_map_poke_run+0x659/0x670 kernel/bpf/arraymap.c:1077
Code: dd e5 ff 48 83 c4 68 5b 41 5c 41 5d 41 5e 41 5f 5d c3 e8 0a dd e5 ff 0f 0b e9 1c fa ff ff e8 fe dc e5 ff 0f 0b e8 f7 dc e5 ff <0f> 0b e8 f0 dc e5 ff 0f 0b e8 e9 dc e5 ff 0f 0b 0f 1f 80 00 00 00
RSP: 0018:ffffc900000c7ab8 EFLAGS: 00010293
RAX: ffffffff81a4b179 RBX: 00000000fffffff0 RCX: ffff88813fe5bb80
RDX: 0000000000000000 RSI: 00000000fffffff0 RDI: 00000000ffffffea
RBP: ffff88801fd6c690 R08: ffffffff81a4af1c R09: fffff52000018f2d
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: dffffc0000000000 R14: 0000000000000001 R15: ffff888020de14d0
FS: 0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb1dd9934b8 CR3: 000000000ce8e000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
fd_array_map_delete_elem+0x13c/0x230 kernel/bpf/arraymap.c:871
bpf_fd_array_map_clear kernel/bpf/arraymap.c:918 [inline]
prog_array_map_clear_deferred+0xfb/0x210 kernel/bpf/arraymap.c:1097
process_one_work+0x8a9/0x11d0 kernel/workqueue.c:2292
worker_thread+0xa47/0x1200 kernel/workqueue.c:2439
kthread+0x28d/0x320 kernel/kthread.c:376
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:prog_array_map_poke_run+0x659/0x670 kernel/bpf/arraymap.c:1077
Code: dd e5 ff 48 83 c4 68 5b 41 5c 41 5d 41 5e 41 5f 5d c3 e8 0a dd e5 ff 0f 0b e9 1c fa ff ff e8 fe dc e5 ff 0f 0b e8 f7 dc e5 ff <0f> 0b e8 f0 dc e5 ff 0f 0b e8 e9 dc e5 ff 0f 0b 0f 1f 80 00 00 00
RSP: 0018:ffffc900000c7ab8 EFLAGS: 00010293
RAX: ffffffff81a4b179 RBX: 00000000fffffff0 RCX: ffff88813fe5bb80
RDX: 0000000000000000 RSI: 00000000fffffff0 RDI: 00000000ffffffea
RBP: ffff88801fd6c690 R08: ffffffff81a4af1c R09: fffff52000018f2d
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: dffffc0000000000 R14: 0000000000000001 R15: ffff888020de14d0
FS: 0000000000000000(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb1dd8dbd58 CR3: 0000000028132000 CR4: 00000000003506f0

syzbot

unread,
Dec 22, 2023, 9:42:05 PM12/22/23
to syzkaller...@googlegroups.com
syzbot suspects this issue could be fixed by backporting the following commit:

commit 4b7de801606e504e69689df71475d27e35336fb3
git tree: upstream
Author: Jiri Olsa <jo...@kernel.org>
Date: Wed Dec 6 08:30:40 2023 +0000

bpf: Fix prog_array_map_poke_run map poke update

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=123ee26ee80000
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