bisecting fixing commit since d7e78d08fa77acdea351c8f628f49ca9a0e1029a building syzkaller on d5a3ae1f760e7cb2cd5a721d9645ae22eae114fe testing commit d7e78d08fa77acdea351c8f628f49ca9a0e1029a with gcc (GCC) 8.1.0 kernel signature: a2a1334845e16a38dcf0bc5464b5060c9991dfc6858bdb175cf0fd550a72f97a all runs: crashed: KASAN: use-after-free Read in u32_clear_hnode testing current HEAD 1752938529c614a8ed4432ecce6ebc95d3b87207 testing commit 1752938529c614a8ed4432ecce6ebc95d3b87207 with gcc (GCC) 8.1.0 kernel signature: ea70def0974a22a15f1a41b602520ce79a2a7ecb5541e0d8d2961bf1df6a1739 all runs: crashed: KASAN: use-after-free Read in u32_clear_hnode revisions tested: 2, total time: 23m40.185609421s (build: 17m12.399065853s, test: 5m54.558997401s) the crash still happens on HEAD commit msg: Linux 4.14.213 crash: KASAN: use-after-free Read in u32_clear_hnode IPv6: ADDRCONF(NETDEV_CHANGE): macvlan1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth0_to_batadv: link becomes ready ================================================================== BUG: KASAN: use-after-free in u32_clear_hnode+0x393/0x410 net/sched/cls_u32.c:590 Read of size 8 at addr ffff8881db7d86b0 by task kworker/u4:6/7160 Bluetooth: hci3 command 0x040f tx timeout CPU: 0 PID: 7160 Comm: kworker/u4:6 Not tainted 4.14.213-syzkaller #0 Bluetooth: hci1 command 0x040f tx timeout Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x14b/0x1f1 lib/dump_stack.c:58 print_address_description.cold.6+0x9/0x1ca mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.7+0x11a/0x2d4 mm/kasan/report.c:409 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 u32_clear_hnode+0x393/0x410 net/sched/cls_u32.c:590 u32_destroy+0x1c4/0x390 net/sched/cls_u32.c:655 tcf_proto_destroy+0x4d/0xd0 net/sched/cls_api.c:180 tcf_chain_flush+0xf8/0x240 net/sched/cls_api.c:208 tcf_block_put+0xbe/0x290 net/sched/cls_api.c:302 hfsc_destroy_qdisc+0xde/0x2b0 net/sched/sch_hfsc.c:1504 qdisc_destroy+0x119/0x2e0 net/sched/sch_generic.c:726 dev_shutdown+0x236/0x419 net/sched/sch_generic.c:1001 rollback_registered_many+0x642/0xb20 net/core/dev.c:7197 unregister_netdevice_many+0x3e/0x1f0 net/core/dev.c:8285 ip_tunnel_delete_net+0x258/0x3b0 net/ipv4/ip_tunnel.c:1083 ipgre_exit_net+0xee/0x1a0 net/ipv4/ip_gre.c:1022 ops_exit_list.isra.3+0x8b/0x120 net/core/net_namespace.c:142 cleanup_net+0x39d/0x7f0 net/core/net_namespace.c:484 process_one_work+0x74f/0x1620 kernel/workqueue.c:2116 worker_thread+0xcc/0xed0 kernel/workqueue.c:2250 kthread+0x338/0x400 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 Allocated by task 7313: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:551 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:536 kmem_cache_alloc_trace+0x152/0x3f0 mm/slab.c:3618 kmalloc include/linux/slab.h:488 [inline] kzalloc include/linux/slab.h:661 [inline] u32_init+0x40c/0x920 net/sched/cls_u32.c:367 tcf_proto_create net/sched/cls_api.c:166 [inline] tc_ctl_tfilter+0x9d8/0x1b2e net/sched/cls_api.c:677 rtnetlink_rcv_msg+0x34c/0x9e0 net/core/rtnetlink.c:4316 netlink_rcv_skb+0x12f/0x3b0 net/netlink/af_netlink.c:2433 rtnetlink_rcv+0x10/0x20 net/core/rtnetlink.c:4328 netlink_unicast_kernel net/netlink/af_netlink.c:1287 [inline] netlink_unicast+0x40b/0x610 net/netlink/af_netlink.c:1313 netlink_sendmsg+0x657/0xc60 net/netlink/af_netlink.c:1878 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xac/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+0x46/0xbb Freed by task 7160: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xab/0x190 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 u32_destroy_key.constprop.6+0xde/0x190 net/sched/cls_u32.c:406 u32_clear_hnode+0x2ab/0x410 net/sched/cls_u32.c:598 u32_destroy+0x1c4/0x390 net/sched/cls_u32.c:655 tcf_proto_destroy+0x4d/0xd0 net/sched/cls_api.c:180 tcf_chain_flush+0xf8/0x240 net/sched/cls_api.c:208 tcf_block_put+0xbe/0x290 net/sched/cls_api.c:302 hfsc_destroy_qdisc+0xde/0x2b0 net/sched/sch_hfsc.c:1504 qdisc_destroy+0x119/0x2e0 net/sched/sch_generic.c:726 dev_shutdown+0x236/0x419 net/sched/sch_generic.c:1001 rollback_registered_many+0x642/0xb20 net/core/dev.c:7197 unregister_netdevice_many+0x3e/0x1f0 net/core/dev.c:8285 ip_tunnel_delete_net+0x258/0x3b0 net/ipv4/ip_tunnel.c:1083 ipgre_exit_net+0xee/0x1a0 net/ipv4/ip_gre.c:1022 ops_exit_list.isra.3+0x8b/0x120 net/core/net_namespace.c:142 cleanup_net+0x39d/0x7f0 net/core/net_namespace.c:484 process_one_work+0x74f/0x1620 kernel/workqueue.c:2116 worker_thread+0xcc/0xed0 kernel/workqueue.c:2250 kthread+0x338/0x400 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 The buggy address belongs to the object at ffff8881db7d8680 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 48 bytes inside of 64-byte region [ffff8881db7d8680, ffff8881db7d86c0) The buggy address belongs to the page: page:ffffea00076df600 count:1 mapcount:0 mapping:ffff8881db7d8000 index:0x0 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffff8881db7d8000 0000000000000000 0000000100000020 raw: ffffea00078dfaa0 ffffea00077dc6e0 ffff8881f6000340 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881db7d8580: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8881db7d8600: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff8881db7d8680: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8881db7d8700: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff8881db7d8780: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ==================================================================