syzbot


BUG: corrupted list in netif_napi_add
Status: fixed on 2022/03/08 16:11
Reported-by: syzbot+62e474dd92a35e3060d8@syzkaller.appspotmail.com
Fix commit: 0315a075f134 net: fix premature exit from NAPI state polling in napi_disable()
First crash: 231d, last: 195d

Cause bisection: introduced by (bisect log) [merge commit]:
commit 9698feb1e8ad53e2379636b6021ce19aa617f88e
Author: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri Oct 8 01:55:28 2021 +0000

  Merge branch 'rcu/next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git

Crash: BUG: corrupted list in netif_napi_add (log)
Repro: syz .config

Fix bisection: fixed by (bisect log) :
commit 0315a075f1343966ea2d9a085666a88a69ea6a3d
Author: Alexander Lobakin <alexandr.lobakin@intel.com>
Date: Wed Nov 10 19:56:05 2021 +0000

  net: fix premature exit from NAPI state polling in napi_disable()

Patch testing requests:
Created Duration User Patch Repo Result
2021/11/05 11:53 14m pabeni@redhat.com patch https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git master report log
2021/11/05 11:41 0m pabeni@redhat.com patch https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git --- error
2021/10/14 11:57 16m pabeni@redhat.com patch git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 683f29b781aeaab6bf302eeb2ef08a5e5f9d8a27 OK
2021/10/14 09:17 16m pabeni@redhat.com patch git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 683f29b781aeaab6bf302eeb2ef08a5e5f9d8a27 report log
2021/10/13 17:31 15m pabeni@redhat.com patch linux-next OK
2021/10/13 16:02 15m pabeni@redhat.com patch https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git master OK
2021/10/13 15:59 15m pabeni@redhat.com patch https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git -- OK
2021/10/13 14:38 0m pabeni@redhat.com patch https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git --- error

Sample crash report:
IPv6: ADDRCONF(NETDEV_CHANGE): vxcan0: link becomes ready
IPv6: ADDRCONF(NETDEV_CHANGE): vxcan1: link becomes ready
list_add double add: new=ffff88807bee5160, prev=ffff88806f85a050, next=ffff88807bee5160.
------------[ cut here ]------------
kernel BUG at lib/list_debug.c:29!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 10609 Comm: syz-executor.5 Not tainted 5.15.0-rc6-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__list_add_valid.cold+0x26/0x3c lib/list_debug.c:29
Code: f0 7b d9 fa 4c 89 e1 48 c7 c7 60 34 e4 89 e8 41 4d f2 ff 0f 0b 48 89 f2 4c 89 e1 48 89 ee 48 c7 c7 a0 35 e4 89 e8 2a 4d f2 ff <0f> 0b 48 89 f1 48 c7 c7 20 35 e4 89 4c 89 e6 e8 16 4d f2 ff 0f 0b
RSP: 0018:ffffc90002eceb68 EFLAGS: 00010286
RAX: 0000000000000058 RBX: 0000000000000040 RCX: 0000000000000000
RDX: ffff888021b28000 RSI: ffffffff815e9b28 RDI: fffff520005d9d5f
RBP: ffff88807bee5160 R08: 0000000000000058 R09: 0000000000000000
R10: ffffffff815e38ce R11: 0000000000000000 R12: ffff88807bee5160
R13: ffff88807bee5000 R14: ffff88807bee5160 R15: ffff88807bee5160
FS:  00007fd17da5d700(0000) GS:ffff8880b9c00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000555a2986ea14 CR3: 0000000060e6b000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 __list_add_rcu include/linux/rculist.h:79 [inline]
 list_add_rcu include/linux/rculist.h:106 [inline]
 netif_napi_add+0x3fd/0x9c0 net/core/dev.c:6906
 veth_enable_xdp_range+0x1b1/0x300 drivers/net/veth.c:1009
 veth_enable_xdp+0x2a5/0x620 drivers/net/veth.c:1063
 veth_xdp_set drivers/net/veth.c:1483 [inline]
 veth_xdp+0x4d4/0x780 drivers/net/veth.c:1523
 dev_xdp_install+0xd5/0x270 net/core/dev.c:9377
 dev_xdp_attach+0x83d/0x1010 net/core/dev.c:9525
 dev_change_xdp_fd+0x246/0x300 net/core/dev.c:9765
 do_setlink+0x2fb4/0x3970 net/core/rtnetlink.c:2931
 rtnl_group_changelink net/core/rtnetlink.c:3242 [inline]
 __rtnl_newlink+0xc06/0x1750 net/core/rtnetlink.c:3396
 rtnl_newlink+0x64/0xa0 net/core/rtnetlink.c:3506
 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5571
 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2491
 netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
 netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1345
 netlink_sendmsg+0x86d/0xda0 net/netlink/af_netlink.c:1916
 sock_sendmsg_nosec net/socket.c:704 [inline]
 sock_sendmsg+0xcf/0x120 net/socket.c:724
 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2409
 ___sys_sendmsg+0xf3/0x170 net/socket.c:2463
 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2492
 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:0x7fd17e2e7a39
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:00007fd17da5d188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007fd17e3faf60 RCX: 00007fd17e2e7a39
RDX: 0000000000000000 RSI: 0000000020000140 RDI: 0000000000000004
RBP: 00007fd17e341e8f R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007fff1781c1ff R14: 00007fd17da5d300 R15: 0000000000022000
Modules linked in:
---[ end trace 03293388b12abd0b ]---
RIP: 0010:__list_add_valid.cold+0x26/0x3c lib/list_debug.c:29
Code: f0 7b d9 fa 4c 89 e1 48 c7 c7 60 34 e4 89 e8 41 4d f2 ff 0f 0b 48 89 f2 4c 89 e1 48 89 ee 48 c7 c7 a0 35 e4 89 e8 2a 4d f2 ff <0f> 0b 48 89 f1 48 c7 c7 20 35 e4 89 4c 89 e6 e8 16 4d f2 ff 0f 0b
RSP: 0018:ffffc90002eceb68 EFLAGS: 00010286
RAX: 0000000000000058 RBX: 0000000000000040 RCX: 0000000000000000
RDX: ffff888021b28000 RSI: ffffffff815e9b28 RDI: fffff520005d9d5f
RBP: ffff88807bee5160 R08: 0000000000000058 R09: 0000000000000000
R10: ffffffff815e38ce R11: 0000000000000000 R12: ffff88807bee5160
R13: ffff88807bee5000 R14: ffff88807bee5160 R15: ffff88807bee5160
FS:  00007fd17da5d700(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007faa4aac8020 CR3: 0000000060e6b000 CR4: 00000000003506e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (17):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-net-kasan-gce 2021/10/28 10:16 net-next 911e3a46fb38 be531bb4 .config log report syz BUG: corrupted list in netif_napi_add
ci-upstream-linux-next-kasan-gce-root 2021/10/09 16:52 linux-next 683f29b781ae 838e7e2c .config log report syz BUG: corrupted list in netif_napi_add
ci-upstream-kasan-gce-root 2021/11/06 22:13 upstream 512b7931ad05 4c1be0be .config log report info BUG: corrupted list in netif_napi_add
ci-upstream-kasan-gce-smack-root 2021/11/03 10:54 upstream dcd68326d29b 17f3edd2 .config log report info BUG: corrupted list in netif_napi_add
ci-qemu-upstream-386 2021/11/03 07:44 upstream 56d33754481f 17f3edd2 .config log report info BUG: corrupted list in netif_napi_add
ci-upstream-bpf-kasan-gce 2021/11/11 22:55 bpf fceb07950a7a 75b04091 .config log report info BUG: corrupted list in netif_napi_add
ci-upstream-bpf-kasan-gce 2021/11/07 07:35 bpf 47b3708c6088 4c1be0be .config log report info BUG: corrupted list in netif_napi_add
ci-upstream-bpf-kasan-gce 2021/11/05 19:23 bpf e41ac2020bca 4c1be0be .config log report info BUG: corrupted list in netif_napi_add
ci-upstream-net-this-kasan-gce 2021/11/03 08:46 net cc0356d6a02e 17f3edd2 .config log report info BUG: corrupted list in netif_napi_add
ci-upstream-bpf-next-kasan-gce 2021/11/14 00:19 bpf-next 325d956d6717 83f5c9b5 .config log report info BUG: corrupted list in netif_napi_add
ci-upstream-bpf-next-kasan-gce 2021/11/12 14:03 bpf-next 5577f24cb04a 75b04091 .config log report info BUG: corrupted list in netif_napi_add
ci-upstream-bpf-next-kasan-gce 2021/10/25 08:16 bpf-next c825f5fee19c 4f0000ee .config log report info BUG: corrupted list in netif_napi_add
ci-upstream-bpf-next-kasan-gce 2021/10/19 00:43 bpf-next 431bfb9ee3e2 24dc29db .config log report info BUG: corrupted list in netif_napi_add
ci-upstream-bpf-next-kasan-gce 2021/10/17 07:41 bpf-next 431bfb9ee3e2 0c5d9412 .config log report info BUG: corrupted list in netif_napi_add
ci-upstream-linux-next-kasan-gce-root 2021/11/10 15:53 linux-next 73e5c18006f5 75b04091 .config log report info BUG: corrupted list in netif_napi_add
ci-upstream-linux-next-kasan-gce-root 2021/11/10 13:29 linux-next 73e5c18006f5 75b04091 .config log report info BUG: corrupted list in netif_napi_add
ci-upstream-linux-next-kasan-gce-root 2021/10/09 11:35 linux-next 683f29b781ae 838e7e2c .config log report info BUG: corrupted list in netif_napi_add