bisecting fixing commit since 4fccc2503536a564a4ba31a1d50439854201659f building syzkaller on 2c36e7a75f8689b3da20e1a81a2ee5391f3af6e5 testing commit 4fccc2503536a564a4ba31a1d50439854201659f with gcc (GCC) 8.1.0 kernel signature: 2f28bdc9195113e08069debd300c2f528ba00e08c7fc1a5f3ca59c97c3cb30df all runs: crashed: KASAN: use-after-free Read in qfq_search_class testing current HEAD 7edd66cf61670d2d0c31f89cb3a247016e489a8a testing commit 7edd66cf61670d2d0c31f89cb3a247016e489a8a with gcc (GCC) 8.1.0 kernel signature: c083a83e074253256c5ad87effef59c63fd3e692b72694bcf5e7c77f837ad86a all runs: crashed: KASAN: use-after-free Read in qfq_search_class revisions tested: 2, total time: 28m22.018716588s (build: 17m45.105243571s, test: 9m47.717099851s) the crash still happens on HEAD commit msg: Linux 4.19.118 crash: KASAN: use-after-free Read in qfq_search_class RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000008 RBP: 000000000076c100 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000009 R13: 00000000000009fa R14: 00000000004cc6eb R15: 0000000000000005 ================================================================== BUG: KASAN: use-after-free in qdisc_class_find include/net/sch_generic.h:528 [inline] BUG: KASAN: use-after-free in qfq_find_class net/sched/sch_qfq.c:214 [inline] BUG: KASAN: use-after-free in qfq_search_class+0x181/0x1f0 net/sched/sch_qfq.c:565 Read of size 4 at addr ffff888090487840 by task syz-executor.4/12101 CPU: 0 PID: 12101 Comm: syz-executor.4 Not tainted 4.19.118-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x123/0x177 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.cold.9+0x242/0x309 mm/kasan/report.c:412 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 qdisc_class_find include/net/sch_generic.h:528 [inline] qfq_find_class net/sched/sch_qfq.c:214 [inline] qfq_search_class+0x181/0x1f0 net/sched/sch_qfq.c:565 tc_ctl_tclass+0x63a/0xba0 net/sched/sch_api.c:1956 rtnetlink_rcv_msg+0x34f/0x8f0 net/core/rtnetlink.c:4777 netlink_rcv_skb+0x142/0x390 net/netlink/af_netlink.c:2455 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4795 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x443/0x650 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x765/0xc40 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 RIP: 0033:0x45c429 Code: ad b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 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 0f 83 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fb2497d0c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fb2497d16d4 RCX: 000000000045c429 RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000003 RBP: 000000000076c060 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000009fa R14: 00000000004cc6eb R15: 000000000076c06c Allocated by task 12102: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 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+0x609/0x14b5 net/sched/sch_qfq.c:476 tc_ctl_tclass+0x3e9/0xba0 net/sched/sch_api.c:1992 rtnetlink_rcv_msg+0x34f/0x8f0 net/core/rtnetlink.c:4777 netlink_rcv_skb+0x142/0x390 net/netlink/af_netlink.c:2455 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4795 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x443/0x650 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x765/0xc40 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 12102: 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+0xd3a/0x14b5 net/sched/sch_qfq.c:530 tc_ctl_tclass+0x3e9/0xba0 net/sched/sch_api.c:1992 rtnetlink_rcv_msg+0x34f/0x8f0 net/core/rtnetlink.c:4777 netlink_rcv_skb+0x142/0x390 net/netlink/af_netlink.c:2455 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4795 netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline] netlink_unicast+0x443/0x650 net/netlink/af_netlink.c:1344 netlink_sendmsg+0x765/0xc40 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 ffff888090487840 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 0 bytes inside of 128-byte region [ffff888090487840, ffff8880904878c0) The buggy address belongs to the page: page:ffffea00024121c0 count:1 mapcount:0 mapping:ffff88812c29c640 index:0x0 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffffea000248dac8 ffffea00023e12c8 ffff88812c29c640 raw: 0000000000000000 ffff888090487000 0000000100000015 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888090487700: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888090487780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888090487800: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff888090487880: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888090487900: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc ==================================================================