bisecting fixing commit since 0be0ee71816b2b6725e2b4f32ad6726c9d729777 building syzkaller on f746151a9375b5b700196314d9e5f308b81e729f testing commit 0be0ee71816b2b6725e2b4f32ad6726c9d729777 with gcc (GCC) 8.1.0 kernel signature: 1687f151e5f0a1ae46ae34e84f64fb528bd2f345 all runs: crashed: KASAN: use-after-free Write in qdisc_class_hash_insert testing current HEAD b3a987b0264d3ddbb24293ebff10eddfc472f653 testing commit b3a987b0264d3ddbb24293ebff10eddfc472f653 with gcc (GCC) 8.1.0 kernel signature: 0f1ce25645142eafab4e8f6752c0f3f35723a547 run #0: crashed: KASAN: use-after-free Write in qdisc_class_hash_insert run #1: crashed: KASAN: use-after-free Write in qdisc_class_hash_insert run #2: crashed: KASAN: use-after-free Write in qdisc_class_hash_insert run #3: crashed: KASAN: use-after-free Write in qdisc_class_hash_insert run #4: crashed: KASAN: use-after-free Write in qdisc_class_hash_insert run #5: crashed: KASAN: use-after-free Write in qdisc_class_hash_insert run #6: crashed: KASAN: use-after-free Write in qdisc_class_hash_insert run #7: crashed: KASAN: use-after-free Write in qdisc_class_hash_insert run #8: crashed: KASAN: use-after-free Write in qdisc_class_hash_insert run #9: crashed: KASAN: use-after-free Read in qdisc_class_hash_grow revisions tested: 2, total time: 22m7.998093772s (build: 11m51.16293647s, test: 9m34.807339344s) the crash still happens on HEAD commit msg: Linux 5.5-rc6 crash: KASAN: use-after-free Read in qdisc_class_hash_grow ================================================================== BUG: KASAN: use-after-free in qdisc_class_hash_grow+0x40a/0x690 net/sched/sch_api.c:679 Read of size 8 at addr ffff88809455ed08 by task syz-executor.3/9597 CPU: 1 PID: 9597 Comm: syz-executor.3 Not tainted 5.5.0-rc6-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+0x12d/0x187 lib/dump_stack.c:118 print_address_description.constprop.8.cold.10+0x9/0x31d mm/kasan/report.c:374 __kasan_report.cold.11+0x1b/0x3a mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:639 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:135 qdisc_class_hash_grow+0x40a/0x690 net/sched/sch_api.c:679 qfq_change_class+0x8fe/0x16c4 net/sched/sch_qfq.c:492 tc_ctl_tclass+0x427/0xbf0 net/sched/sch_api.c:2080 rtnetlink_rcv_msg+0x34a/0x8d0 net/core/rtnetlink.c:5424 netlink_rcv_skb+0x13c/0x380 net/netlink/af_netlink.c:2477 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:5442 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x45e/0x6a0 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x7b0/0xcb0 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:639 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:659 ____sys_sendmsg+0x3b0/0x950 net/socket.c:2330 ___sys_sendmsg+0xe4/0x160 net/socket.c:2384 __sys_sendmmsg+0x160/0x370 net/socket.c:2474 __do_sys_sendmmsg net/socket.c:2503 [inline] __se_sys_sendmmsg net/socket.c:2500 [inline] __x64_sys_sendmmsg+0x98/0x100 net/socket.c:2500 do_syscall_64+0xca/0x5f0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45a639 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:00007f2ea0e55c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007f2ea0e55c90 RCX: 000000000045a639 RDX: 0000000004924b68 RSI: 0000000020000140 RDI: 0000000000000006 RBP: 000000000075c070 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f2ea0e566d4 R13: 00000000004c85bc R14: 00000000004dec68 R15: 0000000000000007 Allocated by task 9504: save_stack+0x21/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] __kasan_kmalloc.constprop.9+0xc7/0xd0 mm/kasan/common.c:513 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:527 __do_kmalloc mm/slab.c:3656 [inline] __kmalloc_track_caller+0x160/0x780 mm/slab.c:3671 kmemdup+0x1b/0x40 mm/util.c:127 kmemdup include/linux/string.h:453 [inline] mpls_dev_sysctl_register+0xac/0x2c0 net/mpls/af_mpls.c:1406 mpls_add_dev net/mpls/af_mpls.c:1472 [inline] mpls_dev_notify+0x1d3/0x600 net/mpls/af_mpls.c:1598 notifier_call_chain+0x8a/0x160 kernel/notifier.c:83 __raw_notifier_call_chain kernel/notifier.c:361 [inline] raw_notifier_call_chain+0x11/0x20 kernel/notifier.c:368 call_netdevice_notifiers_info+0x87/0xd0 net/core/dev.c:1893 call_netdevice_notifiers_extack net/core/dev.c:1905 [inline] call_netdevice_notifiers net/core/dev.c:1919 [inline] register_netdevice+0x643/0xf00 net/core/dev.c:9345 veth_newlink+0x417/0x9e0 drivers/net/veth.c:1281 __rtnl_newlink+0xcdc/0x1480 net/core/rtnetlink.c:3305 rtnl_newlink+0x61/0x90 net/core/rtnetlink.c:3363 rtnetlink_rcv_msg+0x34a/0x8d0 net/core/rtnetlink.c:5424 netlink_rcv_skb+0x13c/0x380 net/netlink/af_netlink.c:2477 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:5442 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x45e/0x6a0 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x7b0/0xcb0 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:639 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:659 ____sys_sendmsg+0x603/0x950 net/socket.c:2330 ___sys_sendmsg+0xe4/0x160 net/socket.c:2384 __sys_sendmsg+0xd9/0x180 net/socket.c:2417 __do_sys_sendmsg net/socket.c:2426 [inline] __se_sys_sendmsg net/socket.c:2424 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2424 do_syscall_64+0xca/0x5f0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 9504: save_stack+0x21/0x90 mm/kasan/common.c:72 set_track mm/kasan/common.c:80 [inline] kasan_set_free_info mm/kasan/common.c:335 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:474 kasan_slab_free+0xe/0x10 mm/kasan/common.c:483 __cache_free mm/slab.c:3426 [inline] kfree+0x108/0x2c0 mm/slab.c:3757 mpls_dev_sysctl_unregister+0x87/0xc0 net/mpls/af_mpls.c:1442 mpls_dev_notify+0x420/0x600 net/mpls/af_mpls.c:1631 notifier_call_chain+0x8a/0x160 kernel/notifier.c:83 __raw_notifier_call_chain kernel/notifier.c:361 [inline] raw_notifier_call_chain+0x11/0x20 kernel/notifier.c:368 call_netdevice_notifiers_info+0x87/0xd0 net/core/dev.c:1893 call_netdevice_notifiers_extack net/core/dev.c:1905 [inline] call_netdevice_notifiers net/core/dev.c:1919 [inline] rollback_registered_many+0x6a3/0xdb0 net/core/dev.c:8744 rollback_registered+0xdc/0x190 net/core/dev.c:8789 unregister_netdevice_queue+0x186/0x240 net/core/dev.c:9888 unregister_netdevice include/linux/netdevice.h:2674 [inline] veth_newlink+0x565/0x9e0 drivers/net/veth.c:1329 __rtnl_newlink+0xcdc/0x1480 net/core/rtnetlink.c:3305 rtnl_newlink+0x61/0x90 net/core/rtnetlink.c:3363 rtnetlink_rcv_msg+0x34a/0x8d0 net/core/rtnetlink.c:5424 netlink_rcv_skb+0x13c/0x380 net/netlink/af_netlink.c:2477 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:5442 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x45e/0x6a0 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x7b0/0xcb0 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:639 [inline] sock_sendmsg+0xb5/0xf0 net/socket.c:659 ____sys_sendmsg+0x603/0x950 net/socket.c:2330 ___sys_sendmsg+0xe4/0x160 net/socket.c:2384 __sys_sendmsg+0xd9/0x180 net/socket.c:2417 __do_sys_sendmsg net/socket.c:2426 [inline] __se_sys_sendmsg net/socket.c:2424 [inline] __x64_sys_sendmsg+0x73/0xb0 net/socket.c:2424 do_syscall_64+0xca/0x5f0 arch/x86/entry/common.c:294 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88809455ed00 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 8 bytes inside of 128-byte region [ffff88809455ed00, ffff88809455ed80) The buggy address belongs to the page: page:ffffea0002515780 refcount:1 mapcount:0 mapping:ffff8880aa800700 index:0x0 raw: 01fffc0000000200 ffffea0002653d88 ffffea0002a2ff88 ffff8880aa800700 raw: 0000000000000000 ffff88809455e000 0000000100000010 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809455ec00: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ffff88809455ec80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88809455ed00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809455ed80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88809455ee00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================