bisecting fixing commit since 4fccc2503536a564a4ba31a1d50439854201659f building syzkaller on 2c36e7a75f8689b3da20e1a81a2ee5391f3af6e5 testing commit 4fccc2503536a564a4ba31a1d50439854201659f with gcc (GCC) 8.1.0 kernel signature: 3b36f5897257d7c1c12668c9083078c6a992895461c5f9b40647b71f20e8d659 all runs: crashed: KASAN: use-after-free Read in qfq_search_class testing current HEAD 1bab61d3e8cd96f2badf515dcb06e4e1029bc017 testing commit 1bab61d3e8cd96f2badf515dcb06e4e1029bc017 with gcc (GCC) 8.1.0 kernel signature: 21523d0bec375cd0f43a5a4ccb98743c49a290b6bc1a5bf943a242e04cdc4cf3 all runs: crashed: KASAN: use-after-free Read in qfq_search_class revisions tested: 2, total time: 25m42.160506865s (build: 17m28.382767865s, test: 7m51.967327338s) the crash still happens on HEAD commit msg: Linux 4.19.124 crash: KASAN: use-after-free Read in qfq_search_class CPU: 0 PID: 10182 Comm: syz-executor.3 Not tainted 4.19.124-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 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 fail_dump lib/fault-inject.c:51 [inline] should_fail.cold.4+0x5/0x13 lib/fault-inject.c:149 Read of size 4 at addr ffff88808e3a8c00 by task syz-executor.4/10177 __should_failslab+0xba/0xf0 mm/failslab.c:32 should_failslab+0x9/0x14 mm/slab_common.c:1558 slab_pre_alloc_hook mm/slab.h:424 [inline] slab_alloc mm/slab.c:3383 [inline] kmem_cache_alloc+0x47/0x730 mm/slab.c:3557 skb_clone+0x115/0x340 net/core/skbuff.c:1284 __netlink_deliver_tap_skb net/netlink/af_netlink.c:296 [inline] __netlink_deliver_tap net/netlink/af_netlink.c:321 [inline] netlink_deliver_tap+0x7d7/0xb00 net/netlink/af_netlink.c:334 __netlink_sendskb+0x62/0xc0 net/netlink/af_netlink.c:1262 netlink_sendskb net/netlink/af_netlink.c:1271 [inline] netlink_unicast+0x4ea/0x650 net/netlink/af_netlink.c:1359 netlink_ack+0x4ca/0x9a0 net/netlink/af_netlink.c:2425 netlink_rcv_skb+0x29c/0x390 net/netlink/af_netlink.c:2461 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:00007fcfc6561c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fcfc65626d4 RCX: 000000000045c429 RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000008 RBP: 000000000076c060 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000009 R13: 00000000000009fa R14: 00000000004cc6eb R15: 0000000000000005 CPU: 1 PID: 10177 Comm: syz-executor.4 Not tainted 4.19.124-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:00007fbbaae27c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007fbbaae286d4 RCX: 000000000045c429 RDX: 0000000000000000 RSI: 00000000200001c0 RDI: 0000000000000003 RBP: 000000000076bfc0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000009fa R14: 00000000004cc6eb R15: 000000000076bfcc Allocated by task 10181: 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 10181: 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 ffff88808e3a8c00 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 0 bytes inside of 128-byte region [ffff88808e3a8c00, ffff88808e3a8c80) The buggy address belongs to the page: page:ffffea000238ea00 count:1 mapcount:0 mapping:ffff88812c29c640 index:0xffff88808e3a8900 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffffea00022cc288 ffffea00022ee588 ffff88812c29c640 raw: ffff88808e3a8900 ffff88808e3a8000 000000010000000a 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808e3a8b00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff88808e3a8b80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88808e3a8c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808e3a8c80: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ffff88808e3a8d00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================