bisecting fixing commit since 4fccc2503536a564a4ba31a1d50439854201659f building syzkaller on 2c36e7a75f8689b3da20e1a81a2ee5391f3af6e5 testing commit 4fccc2503536a564a4ba31a1d50439854201659f with gcc (GCC) 8.4.1 20210217 kernel signature: 09e307a9db223191e21004ca928df5c46bdf7e1a62bef138332f91cdbc0d7923 all runs: crashed: KASAN: use-after-free Read in qfq_search_class testing current HEAD 255b58a2b3af0baa0ee11507390349217b8b73b0 testing commit 255b58a2b3af0baa0ee11507390349217b8b73b0 with gcc (GCC) 8.4.1 20210217 kernel signature: 102aea1456903e0e21de048f5553ad15c2d75ebdd82b4bc82523faa5f25a3207 run #0: crashed: KASAN: use-after-free Read in qfq_search_class run #1: crashed: KASAN: use-after-free Read in qfq_search_class run #2: crashed: KASAN: use-after-free Read in qfq_search_class run #3: crashed: KASAN: use-after-free Read in qfq_search_class run #4: crashed: KASAN: use-after-free Read in qfq_reset_qdisc run #5: crashed: KASAN: use-after-free Read in qfq_reset_qdisc run #6: crashed: KASAN: use-after-free Read in qfq_reset_qdisc run #7: crashed: KASAN: use-after-free Read in qfq_reset_qdisc run #8: crashed: KASAN: use-after-free Read in qfq_reset_qdisc run #9: crashed: KASAN: use-after-free Read in qfq_reset_qdisc revisions tested: 2, total time: 34m3.263329708s (build: 15m35.339674163s, test: 17m22.310451821s) the crash still happens on HEAD commit msg: Linux 4.19.176 crash: KASAN: use-after-free Read in qfq_reset_qdisc device veth1_macvtap left promiscuous mode device veth0_macvtap left promiscuous mode device veth1_vlan left promiscuous mode device veth0_vlan left promiscuous mode ================================================================== BUG: KASAN: use-after-free in qfq_reset_qdisc+0x216/0x290 net/sched/sch_qfq.c:1468 Read of size 8 at addr ffff8881c46d9708 by task kworker/u4:6/7164 CPU: 1 PID: 7164 Comm: kworker/u4:6 Not tainted 4.19.176-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x123/0x171 lib/dump_stack.c:118 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold.9+0x242/0x2fe mm/kasan/report.c:396 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 qfq_reset_qdisc+0x216/0x290 net/sched/sch_qfq.c:1468 qdisc_destroy+0xfb/0x650 net/sched/sch_generic.c:981 dev_shutdown+0x236/0x410 net/sched/sch_generic.c:1321 rollback_registered_many+0x4b7/0xb50 net/core/dev.c:8181 unregister_netdevice_many+0x3e/0x1f0 net/core/dev.c:9316 default_device_exit_batch+0x2e4/0x3d0 net/core/dev.c:9787 ops_exit_list.isra.5+0xd3/0x120 net/core/net_namespace.c:156 cleanup_net+0x368/0x850 net/core/net_namespace.c:553 process_one_work+0x830/0x1670 kernel/workqueue.c:2152 worker_thread+0x85/0xb60 kernel/workqueue.c:2295 kthread+0x347/0x410 kernel/kthread.c:259 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:415 Allocated by task 13919: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc mm/kasan/kasan.c:553 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:531 kmem_cache_alloc_trace+0x152/0x740 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] qfq_change_class+0x613/0x14e0 net/sched/sch_qfq.c:476 tc_ctl_tclass+0x3e9/0xba0 net/sched/sch_api.c:1993 rtnetlink_rcv_msg+0x34f/0x8f0 net/core/rtnetlink.c:4778 netlink_rcv_skb+0x13e/0x3d0 net/netlink/af_netlink.c:2455 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4796 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x443/0x650 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x764/0xc60 net/netlink/af_netlink.c:1909 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:632 ___sys_sendmsg+0x647/0x950 net/socket.c:2115 __sys_sendmsg+0xd9/0x180 net/socket.c:2153 __do_sys_sendmsg net/socket.c:2162 [inline] __se_sys_sendmsg net/socket.c:2160 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2160 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 13919: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3503 [inline] kfree+0xcf/0x220 mm/slab.c:3822 qfq_change_class+0xd44/0x14e0 net/sched/sch_qfq.c:530 tc_ctl_tclass+0x3e9/0xba0 net/sched/sch_api.c:1993 rtnetlink_rcv_msg+0x34f/0x8f0 net/core/rtnetlink.c:4778 netlink_rcv_skb+0x13e/0x3d0 net/netlink/af_netlink.c:2455 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4796 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x443/0x650 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x764/0xc60 net/netlink/af_netlink.c:1909 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:632 ___sys_sendmsg+0x647/0x950 net/socket.c:2115 __sys_sendmsg+0xd9/0x180 net/socket.c:2153 __do_sys_sendmsg net/socket.c:2162 [inline] __se_sys_sendmsg net/socket.c:2160 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2160 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8881c46d96c0 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 72 bytes inside of 128-byte region [ffff8881c46d96c0, ffff8881c46d9740) The buggy address belongs to the page: page:ffffea000711b640 count:1 mapcount:0 mapping:ffff8881f6400640 index:0x0 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffffea00077f02c8 ffffea00077d60c8 ffff8881f6400640 raw: 0000000000000000 ffff8881c46d9000 0000000100000015 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881c46d9600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881c46d9680: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff8881c46d9700: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8881c46d9780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881c46d9800: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ==================================================================