[syzbot] WARNING: kmalloc bug in bpf

19 views
Skip to first unread message

syzbot

unread,
Nov 25, 2021, 11:20:29 PM11/25/21
to and...@kernel.org, a...@kernel.org, b...@vger.kernel.org, dan...@iogearbox.net, da...@davemloft.net, ha...@kernel.org, john.fa...@gmail.com, ka...@fb.com, kps...@kernel.org, ku...@kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, songliu...@fb.com, syzkall...@googlegroups.com, y...@fb.com
Hello,

syzbot found the following issue on:

HEAD commit: e4f7ac90c2b0 selftests/bpf: Mix legacy (maps) and modern (..
git tree: bpf-next
console output: https://syzkaller.appspot.com/x/log.txt?x=17418e09b00000
kernel config: https://syzkaller.appspot.com/x/.config?x=a262045c4c15a9e0
dashboard link: https://syzkaller.appspot.com/bug?extid=cecf5b7071a0dfb76530
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2

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

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

------------[ cut here ]------------
WARNING: CPU: 1 PID: 372 at mm/util.c:597 kvmalloc_node+0x111/0x120 mm/util.c:597
Modules linked in:
CPU: 1 PID: 372 Comm: syz-executor.4 Not tainted 5.15.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:kvmalloc_node+0x111/0x120 mm/util.c:597
Code: 01 00 00 00 4c 89 e7 e8 7d f7 0c 00 49 89 c5 e9 69 ff ff ff e8 60 20 d1 ff 41 89 ed 41 81 cd 00 20 01 00 eb 95 e8 4f 20 d1 ff <0f> 0b e9 4c ff ff ff 0f 1f 84 00 00 00 00 00 55 48 89 fd 53 e8 36
RSP: 0018:ffffc90002bf7c98 EFLAGS: 00010216
RAX: 00000000000000ec RBX: 1ffff9200057ef9f RCX: ffffc9000ac63000
RDX: 0000000000040000 RSI: ffffffff81a6a621 RDI: 0000000000000003
RBP: 0000000000102cc0 R08: 000000007fffffff R09: 00000000ffffffff
R10: ffffffff81a6a5de R11: 0000000000000000 R12: 00000000ffff9aaa
R13: 0000000000000000 R14: 00000000ffffffff R15: 0000000000000000
FS: 00007f05f2573700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b2f424000 CR3: 0000000027d2c000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
kvmalloc include/linux/slab.h:741 [inline]
map_lookup_elem kernel/bpf/syscall.c:1090 [inline]
__sys_bpf+0x3a5b/0x5f00 kernel/bpf/syscall.c:4603
__do_sys_bpf kernel/bpf/syscall.c:4722 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4720 [inline]
__x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:4720
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f05f4ffdae9
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f05f2573188 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 00007f05f5110f60 RCX: 00007f05f4ffdae9
RDX: 0000000000000020 RSI: 0000000020000100 RDI: 0000000000000001
RBP: 00007f05f5057f6d R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fffa4b9a31f R14: 00007f05f2573300 R15: 0000000000022000
</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.

syzbot

unread,
Dec 11, 2021, 5:33:19 PM12/11/21
to and...@kernel.org, a...@kernel.org, b...@vger.kernel.org, dan...@iogearbox.net, da...@davemloft.net, ha...@kernel.org, john.fa...@gmail.com, ka...@fb.com, kps...@kernel.org, ku...@kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, songliu...@fb.com, syzkall...@googlegroups.com, y...@fb.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 229fae38d0fc libbpf: Add "bool skipped" to struct bpf_map
git tree: bpf-next
console output: https://syzkaller.appspot.com/x/log.txt?x=1519ce4db00000
kernel config: https://syzkaller.appspot.com/x/.config?x=a262045c4c15a9e0
dashboard link: https://syzkaller.appspot.com/bug?extid=cecf5b7071a0dfb76530
compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=119b6f3ab00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=176cf805b00000

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

------------[ cut here ]------------
WARNING: CPU: 1 PID: 3597 at mm/util.c:597 kvmalloc_node+0x111/0x120 mm/util.c:597
Modules linked in:
CPU: 1 PID: 3597 Comm: syz-executor773 Not tainted 5.15.0-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:kvmalloc_node+0x111/0x120 mm/util.c:597
Code: 01 00 00 00 4c 89 e7 e8 7d f7 0c 00 49 89 c5 e9 69 ff ff ff e8 a0 7e d0 ff 41 89 ed 41 81 cd 00 20 01 00 eb 95 e8 8f 7e d0 ff <0f> 0b e9 4c ff ff ff 0f 1f 84 00 00 00 00 00 55 48 89 fd 53 e8 76
RSP: 0018:ffffc900020ffc58 EFLAGS: 00010293
RAX: 0000000000000000 RBX: 1ffff9200041ff97 RCX: 0000000000000000
RDX: ffff8880766a1d00 RSI: ffffffff81a747e1 RDI: 0000000000000003
RBP: 0000000000102cc0 R08: 000000007fffffff R09: 00000000ffffffff
R10: ffffffff81a7479e R11: 0000000000000000 R12: 00000000fffffffe
R13: 0000000000000000 R14: 00000000ffffffff R15: 0000000000000000
FS: 0000555556e04300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020000140 CR3: 000000001db54000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
kvmalloc include/linux/slab.h:741 [inline]
map_lookup_elem kernel/bpf/syscall.c:1090 [inline]
__sys_bpf+0x3a6b/0x5f10 kernel/bpf/syscall.c:4603
__do_sys_bpf kernel/bpf/syscall.c:4722 [inline]
__se_sys_bpf kernel/bpf/syscall.c:4720 [inline]
__x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:4720
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x44/0xae
RIP: 0033:0x7f6bde27f079
Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffc0cb30c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000141
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f6bde27f079
RDX: 0000000000000020 RSI: 0000000020000100 RDI: 0000000000000001
RBP: 00007f6bde243060 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f6bde2430f0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
</TASK>

syzbot

unread,
Dec 12, 2021, 9:46:09 PM12/12/21
to and...@kernel.org, a...@kernel.org, b...@vger.kernel.org, dan...@iogearbox.net, da...@davemloft.net, ha...@kernel.org, ji...@nvidia.com, john.fa...@gmail.com, ka...@fb.com, kps...@kernel.org, ku...@kernel.org, leo...@nvidia.com, linux-...@vger.kernel.org, net...@vger.kernel.org, songliu...@fb.com, syzkall...@googlegroups.com, y...@fb.com
syzbot has bisected this issue to:

commit 22849b5ea5952d853547cc5e0651f34a246b2a4f
Author: Leon Romanovsky <leo...@nvidia.com>
Date: Thu Oct 21 14:16:14 2021 +0000

devlink: Remove not-executed trap policer notifications

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1465b449b00000
start commit: ee60e626d536 netdevsim: don't overwrite read only ethtool ..
git tree: net
final oops: https://syzkaller.appspot.com/x/report.txt?x=1665b449b00000
console output: https://syzkaller.appspot.com/x/log.txt?x=1265b449b00000
kernel config: https://syzkaller.appspot.com/x/.config?x=221ffc09e39ebbd1
dashboard link: https://syzkaller.appspot.com/bug?extid=cecf5b7071a0dfb76530
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12a14b55b00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13375f75b00000

Reported-by: syzbot+cecf5b...@syzkaller.appspotmail.com
Fixes: 22849b5ea595 ("devlink: Remove not-executed trap policer notifications")

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

syzbot

unread,
Apr 22, 2022, 2:53:11 PM4/22/22
to and...@kernel.org, a...@kernel.org, b...@vger.kernel.org, dan...@iogearbox.net, da...@davemloft.net, ha...@kernel.org, ji...@nvidia.com, john.fa...@gmail.com, ka...@fb.com, kps...@kernel.org, ku...@kernel.org, leo...@nvidia.com, linux-...@vger.kernel.org, net...@vger.kernel.org, songliu...@fb.com, syzkall...@googlegroups.com, torv...@linux-foundation.org, y...@fb.com
syzbot suspects this issue was fixed by commit:

commit 0708a0afe291bdfe1386d74d5ec1f0c27e8b9168
Author: Daniel Borkmann <dan...@iogearbox.net>
Date: Fri Mar 4 14:26:32 2022 +0000

mm: Consider __GFP_NOWARN flag for oversized kvmalloc() calls

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=1499c6fcf00000
start commit: 1d5a47424040 sfc: The RX page_ring is optional
git tree: net
kernel config: https://syzkaller.appspot.com/x/.config?x=1a86c22260afac2f
dashboard link: https://syzkaller.appspot.com/bug?extid=cecf5b7071a0dfb76530
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=176738e7b00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13b4508db00000

If the result looks correct, please mark the issue as fixed by replying with:

#syz fix: mm: Consider __GFP_NOWARN flag for oversized kvmalloc() calls

Dmitry Vyukov

unread,
Apr 23, 2022, 8:13:53 AM4/23/22
to syzbot, and...@kernel.org, a...@kernel.org, b...@vger.kernel.org, dan...@iogearbox.net, da...@davemloft.net, ha...@kernel.org, ji...@nvidia.com, john.fa...@gmail.com, ka...@fb.com, kps...@kernel.org, ku...@kernel.org, leo...@nvidia.com, linux-...@vger.kernel.org, net...@vger.kernel.org, songliu...@fb.com, syzkall...@googlegroups.com, torv...@linux-foundation.org, y...@fb.com
Looks reasonable:
Reply all
Reply to author
Forward
0 new messages