Re: general protection fault in cbs_destroy

From: Cong Wang
Date: Mon Sep 09 2019 - 18:23:42 EST


On Sun, Sep 8, 2019 at 12:29 AM Hillf Danton <hdanton@xxxxxxxx> wrote:
>
>
> > syzbot found the following crash on Sat, 07 Sep 2019 23:08:08 -0700
> >
> > HEAD commit: 3b47fd5c Merge tag 'nfs-for-5.3-4' of git://git.linux-nfs...
> > git tree: upstream
> > console output: https://syzkaller.appspot.com/x/log.txt?x=14854e71600000
> > kernel config: https://syzkaller.appspot.com/x/.config?x=144488c6c6c6d2b6
> > dashboard link: https://syzkaller.appspot.com/bug?extid=3a8d6a998cbb73bcf337
> > compiler: clang version 9.0.0 (/home/glider/llvm/clang
> > 80fee25776c2fb61e74c1ecb1a523375c2500b69)
> > syz repro: https://syzkaller.appspot.com/x/repro.syz?x=17998f9e600000
> > C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10421efa600000
> >
> > general protection fault: 0000 [#1] PREEMPT SMP KASAN
> > CPU: 0 PID: 9249 Comm: syz-executor457 Not tainted 5.3.0-rc7+ #0
> > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
> > Google 01/01/2011
> > RIP: 0010:__list_del_entry_valid+0x6b/0x100 lib/list_debug.c:51
> > Code: 4c 89 f7 e8 97 d0 58 fe 48 ba 00 01 00 00 00 00 ad de 49 8b 1e 48 39
> > d3 74 54 48 83 c2 22 49 39 d7 74 5e 4c 89 f8 48 c1 e8 03 <42> 80 3c 20 00
> > 74 08 4c 89 ff e8 66 d0 58 fe 49 8b 17 4c 39 f2 75
> > RSP: 0018:ffff88809898f568 EFLAGS: 00010246
> > RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000001
> > RDX: dead000000000122 RSI: 0000000000000004 RDI: ffff88809fb5a7e8
> > RBP: ffff88809898f588 R08: dffffc0000000000 R09: ffffed1013131ea8
> > R10: ffffed1013131ea8 R11: 0000000000000000 R12: dffffc0000000000
> > R13: ffff88809fb5a480 R14: ffff88809fb5a7e0 R15: 0000000000000000
> > FS: 00005555568cb880(0000) GS:ffff8880aea00000(0000) knlGS:0000000000000000
> > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > CR2: 0000000020000610 CR3: 00000000a3968000 CR4: 00000000001406f0
> > DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> > DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> > Call Trace:
> > __list_del_entry include/linux/list.h:131 [inline]
> > list_del include/linux/list.h:139 [inline]
> > cbs_destroy+0x85/0x3e0 net/sched/sch_cbs.c:435
> > qdisc_create+0xff8/0x13e0 net/sched/sch_api.c:1302
> > tc_modify_qdisc+0x989/0x1ea0 net/sched/sch_api.c:1652
> > rtnetlink_rcv_msg+0x889/0xd40 net/core/rtnetlink.c:5223
> > netlink_rcv_skb+0x19e/0x3d0 net/netlink/af_netlink.c:2477
> > rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5241
> > netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline]
> > netlink_unicast+0x787/0x900 net/netlink/af_netlink.c:1328
> > netlink_sendmsg+0x993/0xc50 net/netlink/af_netlink.c:1917
> > sock_sendmsg_nosec net/socket.c:637 [inline]
> > sock_sendmsg net/socket.c:657 [inline]
> > ___sys_sendmsg+0x60d/0x910 net/socket.c:2311
> > __sys_sendmsg net/socket.c:2356 [inline]
> > __do_sys_sendmsg net/socket.c:2365 [inline]
> > __se_sys_sendmsg net/socket.c:2363 [inline]
> > __x64_sys_sendmsg+0x17c/0x200 net/socket.c:2363
> > do_syscall_64+0xfe/0x140 arch/x86/entry/common.c:296
> > entry_SYSCALL_64_after_hwframe+0x49/0xbe
>
> --- a/net/sched/sch_cbs.c
> +++ b/net/sched/sch_cbs.c
> @@ -401,6 +401,7 @@ static int cbs_init(struct Qdisc *sch, s
> if (!q->qdisc)
> return -ENOMEM;
>
> + INIT_LIST_HEAD(&q->cbs_list);
> qdisc_hash_add(q->qdisc, false);
>
> q->queue = sch->dev_queue - netdev_get_tx_queue(dev, 0);

There is already a patch for the same bug:
http://patchwork.ozlabs.org/patch/1154697/

Vinicius, can you send V2 as David requested?

Thanks.