bisecting fixing commit since 4fccc2503536a564a4ba31a1d50439854201659f building syzkaller on 2c36e7a75f8689b3da20e1a81a2ee5391f3af6e5 testing commit 4fccc2503536a564a4ba31a1d50439854201659f with gcc (GCC) 8.1.0 kernel signature: b90cc7a104f38a715c8cdd085a8fce3afba7ebf82727afdc9adfa8a1e6f94329 all runs: crashed: KASAN: use-after-free Read in qfq_search_class testing current HEAD ad326970d25cc85128cd22d62398751ad072efff testing commit ad326970d25cc85128cd22d62398751ad072efff with gcc (GCC) 8.1.0 kernel signature: 885f2611281e599bb00cad81c6a219e561d6b19215bf069d30fc0bc229430513 all runs: crashed: KASAN: use-after-free Read in qfq_search_class revisions tested: 2, total time: 27m14.966294949s (build: 18m18.784757146s, test: 7m54.350729489s) the crash still happens on HEAD commit msg: Linux 4.19.152 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: 00000000004cc76b 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 ffff888095ac4d80 by task syz-executor.0/9556 CPU: 1 PID: 9556 Comm: syz-executor.0 Not tainted 4.19.152-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: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+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:0x45c4a9 Code: 2d 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 fb b5 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f9da5dc6c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f9da5dc76d4 RCX: 000000000045c4a9 RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000003 RBP: 000000000076c060 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000009fa R14: 00000000004cc76b R15: 000000000076c06c Allocated by task 9563: 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: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+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 9563: 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: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+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 ffff888095ac4d80 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 0 bytes inside of 128-byte region [ffff888095ac4d80, ffff888095ac4e00) The buggy address belongs to the page: page:ffffea000256b100 count:1 mapcount:0 mapping:ffff88812c29c640 index:0x0 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffffea0002a57908 ffffea000242f888 ffff88812c29c640 raw: 0000000000000000 ffff888095ac4000 0000000100000015 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888095ac4c80: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff888095ac4d00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff888095ac4d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888095ac4e00: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff888095ac4e80: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ==================================================================