bisecting fixing commit since d7e78d08fa77acdea351c8f628f49ca9a0e1029a building syzkaller on d5a3ae1f760e7cb2cd5a721d9645ae22eae114fe testing commit d7e78d08fa77acdea351c8f628f49ca9a0e1029a with gcc (GCC) 8.4.1 20210217 kernel signature: dd8024b0f8f04affc101c96d91b768da79bbe574d6f7449046179e099f8c98f1 all runs: crashed: KASAN: use-after-free Read in u32_clear_hnode testing current HEAD 7d7d1c0ab3eb7c8d8f63a126535018007823b207 testing commit 7d7d1c0ab3eb7c8d8f63a126535018007823b207 with gcc (GCC) 8.4.1 20210217 kernel signature: 4287c60b08f886b95ca424ec4b6032b9c3a4ab3515a4e7fe287f4bd972c640f4 all runs: crashed: KASAN: use-after-free Read in u32_clear_hnode revisions tested: 2, total time: 21m2.915325126s (build: 14m11.27717914s, test: 6m31.336155333s) the crash still happens on HEAD commit msg: Linux 4.14.232 crash: KASAN: use-after-free Read in u32_clear_hnode IPv6: ADDRCONF(NETDEV_CHANGE): veth1_macvtap: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth0_macvtap: link becomes ready device veth0_macvtap entered promiscuous mode IPv6: ADDRCONF(NETDEV_UP): macvtap0: link is not ready ================================================================== BUG: KASAN: use-after-free in u32_clear_hnode+0x393/0x410 net/sched/cls_u32.c:590 Read of size 8 at addr ffff8881d6f21430 by task kworker/u4:2/29 CPU: 1 PID: 29 Comm: kworker/u4:2 Not tainted 4.14.232-syzkaller #0 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/0x1e7 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 mm/kasan/report.c:409 [inline] kasan_report.cold.7+0x11a/0x2d3 mm/kasan/report.c:393 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 u32_clear_hnode+0x393/0x410 net/sched/cls_u32.c:590 u32_destroy+0x1ba/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/0x280 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/0x420 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/0xee0 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 7284: 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+0x9c8/0x1b20 net/sched/cls_api.c:677 rtnetlink_rcv_msg+0x34c/0x9e0 net/core/rtnetlink.c:4316 Bluetooth: hci3 command 0x0419 tx timeout 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+0x639/0xbe0 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 29: 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+0xd7/0x190 net/sched/cls_u32.c:406 u32_clear_hnode+0x2ab/0x410 net/sched/cls_u32.c:598 u32_destroy+0x1ba/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/0x280 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/0x420 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/0xee0 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 ffff8881d6f21400 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 48 bytes inside of 64-byte region [ffff8881d6f21400, ffff8881d6f21440) The buggy address belongs to the page: page:ffffea00075bc840 count:1 mapcount:0 mapping:ffff8881d6f21000 index:0x0 flags: 0x17ffe0000000100(slab) raw: 017ffe0000000100 ffff8881d6f21000 0000000000000000 0000000100000020 raw: ffffea000794dc20 ffffea00075a4620 ffff8881f6000340 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d6f21300: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8881d6f21380: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff8881d6f21400: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8881d6f21480: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ffff8881d6f21500: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ================================================================== Bluetooth: hci2 command 0x040f tx timeout Bluetooth: hci0 command 0x040f tx timeout Bluetooth: hci1 command 0x0419 tx timeout kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access general protection fault: 0000 [#1] PREEMPT SMP KASAN Modules linked in: CPU: 0 PID: 29 Comm: kworker/u4:2 Tainted: G B 4.14.232-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net task: ffff8881f4e96080 task.stack: ffff8881f4ea0000 RIP: 0010:u32_clear_hnode+0xb7/0x410 net/sched/cls_u32.c:591 RSP: 0018:ffff8881f4ea7778 EFLAGS: 00010207 RAX: 00000000c0000000 RBX: 0000000000000006 RCX: ffffffff8528f873 RDX: 0000000000000004 RSI: 0000000000000008 RDI: ffffffff8833f720 RBP: ffff8881f4ea77f8 R08: 0000000000000000 R09: 0000000000000000 R10: fffffbfff1344ec3 R11: dffffc0000000000 R12: 0000000600000007 R13: dffffc0000000000 R14: ffff8881d5603500 R15: dffffc0000000000 FS: 0000000000000000(0000) GS:ffff8881f6600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f55151c8000 CR3: 0000000007e6a003 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: u32_destroy+0x1ba/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/0x280 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/0x420 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/0xee0 kernel/workqueue.c:2250 kthread+0x338/0x400 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 Code: 00 4d 8b 24 de 4d 85 e4 0f 84 47 02 00 00 e8 11 0a 21 fc 85 c0 74 0d 80 3d 85 89 85 03 00 0f 84 00 02 00 00 4c 89 e0 48 c1 e8 03 <42> 80 3c 38 00 0f 85 bb 02 00 00 48 8b 45 b8 4d 8b 2c 24 42 80 RIP: u32_clear_hnode+0xb7/0x410 net/sched/cls_u32.c:591 RSP: ffff8881f4ea7778 ---[ end trace 26dd6af561644725 ]---