bisecting fixing commit since 01364dad1d4577e27a57729d41053f661bb8a5b9 building syzkaller on 2c31c529a9a44be5d99e769204b7a4b84b93eec1 testing commit 01364dad1d4577e27a57729d41053f661bb8a5b9 with gcc (GCC) 8.1.0 kernel signature: a476583d636129caf74d684fa3a3901455e7a3e5e3e7abc025fee816a9acba00 all runs: crashed: KASAN: use-after-free Write in qdisc_class_hash_insert testing current HEAD c10b57a567e4333b9fdf60b5ec36de9859263ca2 testing commit c10b57a567e4333b9fdf60b5ec36de9859263ca2 with gcc (GCC) 8.1.0 kernel signature: 8114c05c96de6b4de586b8c5b501962f2d5fd549f78c42e3a73da71403b8ee1c all runs: crashed: KASAN: use-after-free Write in qdisc_class_hash_insert revisions tested: 2, total time: 26m3.143800275s (build: 19m12.147463315s, test: 6m5.329642941s) the crash still happens on HEAD commit msg: Linux 4.14.176 crash: KASAN: use-after-free Write in qdisc_class_hash_insert RDX: 0492492492492642 RSI: 0000000020000180 RDI: 0000000000000009 RBP: 000000000076c040 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000000a R13: 00000000000008d2 R14: 00000000004cb75c R15: 0000000000000006 ================================================================== BUG: KASAN: use-after-free in hlist_add_head include/linux/list.h:704 [inline] BUG: KASAN: use-after-free in qdisc_class_hash_insert+0x293/0x2a0 net/sched/sch_api.c:694 Write of size 8 at addr ffff8880a06a7310 by task syz-executor.4/7880 CPU: 1 PID: 7880 Comm: syz-executor.4 Not tainted 4.14.176-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xf7/0x13b lib/dump_stack.c:58 print_address_description.cold.7+0x9/0x1c9 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.8+0x11a/0x2d3 mm/kasan/report.c:409 __asan_report_store8_noabort+0x17/0x20 mm/kasan/report.c:435 hlist_add_head include/linux/list.h:704 [inline] qdisc_class_hash_insert+0x293/0x2a0 net/sched/sch_api.c:694 qfq_change_class+0x9de/0x12eb net/sched/sch_qfq.c:500 tc_ctl_tclass+0x3af/0xb50 net/sched/sch_api.c:1848 rtnetlink_rcv_msg+0x34c/0x9e0 net/core/rtnetlink.c:4315 netlink_rcv_skb+0x133/0x370 net/netlink/af_netlink.c:2433 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4327 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x40b/0x600 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x730/0xbd0 net/netlink/af_netlink.c:1878 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:656 ___sys_sendmsg+0x282/0x920 net/socket.c:2062 __sys_sendmmsg+0x126/0x300 net/socket.c:2152 SYSC_sendmmsg net/socket.c:2183 [inline] SyS_sendmmsg+0xd/0x20 net/socket.c:2178 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x45c849 RSP: 002b:00007f179020fc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007f17902106d4 RCX: 000000000045c849 RDX: 0492492492492642 RSI: 0000000020000180 RDI: 0000000000000009 RBP: 000000000076bfa0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000000a R13: 00000000000008d2 R14: 00000000004cb75c R15: 0000000000000006 Allocated by task 7880: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x152/0x7a0 mm/slab.c:3618 kmalloc include/linux/slab.h:488 [inline] kzalloc include/linux/slab.h:661 [inline] qfq_change_class+0x7ce/0x12eb net/sched/sch_qfq.c:475 tc_ctl_tclass+0x3af/0xb50 net/sched/sch_api.c:1848 rtnetlink_rcv_msg+0x34c/0x9e0 net/core/rtnetlink.c:4315 netlink_rcv_skb+0x133/0x370 net/netlink/af_netlink.c:2433 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4327 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x40b/0x600 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x730/0xbd0 net/netlink/af_netlink.c:1878 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:656 ___sys_sendmsg+0x282/0x920 net/socket.c:2062 __sys_sendmmsg+0x126/0x300 net/socket.c:2152 SYSC_sendmmsg net/socket.c:2183 [inline] SyS_sendmmsg+0xd/0x20 net/socket.c:2178 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 7880: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 qfq_change_class+0xd2b/0x12eb net/sched/sch_qfq.c:529 tc_ctl_tclass+0x3af/0xb50 net/sched/sch_api.c:1848 rtnetlink_rcv_msg+0x34c/0x9e0 net/core/rtnetlink.c:4315 netlink_rcv_skb+0x133/0x370 net/netlink/af_netlink.c:2433 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4327 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x40b/0x600 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x730/0xbd0 net/netlink/af_netlink.c:1878 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:656 ___sys_sendmsg+0x282/0x920 net/socket.c:2062 __sys_sendmmsg+0x126/0x300 net/socket.c:2152 SYSC_sendmmsg net/socket.c:2183 [inline] SyS_sendmmsg+0xd/0x20 net/socket.c:2178 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff8880a06a7300 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 16 bytes inside of 128-byte region [ffff8880a06a7300, ffff8880a06a7380) The buggy address belongs to the page: page:ffffea000281a9c0 count:1 mapcount:0 mapping:ffff8880a06a7000 index:0x0 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffff8880a06a7000 0000000000000000 0000000100000015 raw: ffffea000292e6a0 ffffea00027e1220 ffff8880aa800640 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a06a7200: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff8880a06a7280: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff8880a06a7300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a06a7380: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff8880a06a7400: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ==================================================================