bisecting fixing commit since 12cd844a39ed16aa183a820a54fe6f9a0bb4cd14 building syzkaller on 749688d22abef3f3cb9a0480e15c19a3f2ed8e13 testing commit 12cd844a39ed16aa183a820a54fe6f9a0bb4cd14 with gcc (GCC) 8.1.0 kernel signature: 082e5eee95f1d21eaef3c8cc7f6d7b6ca1d65ad31894c468ef03f44de37d1d7a all runs: crashed: KASAN: use-after-free Read in xfrm6_tunnel_destroy testing current HEAD c196b3a9c83ae3491280b739d231d02b3cb9d041 testing commit c196b3a9c83ae3491280b739d231d02b3cb9d041 with gcc (GCC) 8.1.0 kernel signature: e9855a183c4b3581999ad0c017ef1997e1a5971b7b1c7ff860bc045e5f285023 all runs: crashed: KASAN: use-after-free Read in xfrm6_tunnel_destroy revisions tested: 2, total time: 41m55.499609911s (build: 20m40.640401905s, test: 20m1.533342011s) the crash still happens on HEAD commit msg: Linux 4.14.210 crash: KASAN: use-after-free Read in xfrm6_tunnel_destroy bond0 (unregistering): Releasing backup interface bond_slave_1 bond0 (unregistering): Releasing backup interface bond_slave_0 bond0 (unregistering): Released all slaves IPVS: ftp: loaded support on port[0] = 21 ================================================================== BUG: KASAN: use-after-free in xfrm6_tunnel_free_spi net/ipv6/xfrm6_tunnel.c:208 [inline] BUG: KASAN: use-after-free in xfrm6_tunnel_destroy+0x59d/0x680 net/ipv6/xfrm6_tunnel.c:303 Read of size 8 at addr ffff8881e6362438 by task kworker/0:1/16006 CPU: 0 PID: 16006 Comm: kworker/0:1 Not tainted 4.14.210-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events xfrm_state_gc_task 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_load8_noabort+0x14/0x20 mm/kasan/report.c:430 xfrm6_tunnel_free_spi net/ipv6/xfrm6_tunnel.c:208 [inline] xfrm6_tunnel_destroy+0x59d/0x680 net/ipv6/xfrm6_tunnel.c:303 xfrm_state_gc_destroy net/xfrm/xfrm_state.c:449 [inline] xfrm_state_gc_task+0x46a/0x760 net/xfrm/xfrm_state.c:472 process_one_work+0x79e/0x16c0 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 5810: 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 __do_kmalloc mm/slab.c:3720 [inline] __kmalloc+0x15b/0x7b0 mm/slab.c:3729 kmalloc include/linux/slab.h:493 [inline] kzalloc include/linux/slab.h:661 [inline] ops_init+0xc2/0x380 net/core/net_namespace.c:108 setup_net+0x233/0x4f0 net/core/net_namespace.c:295 copy_net_ns+0x16b/0x3c0 net/core/net_namespace.c:419 create_new_namespaces+0x476/0x740 kernel/nsproxy.c:107 unshare_nsproxy_namespaces+0x87/0x1a0 kernel/nsproxy.c:206 SYSC_unshare kernel/fork.c:2412 [inline] SyS_unshare+0x299/0x6e0 kernel/fork.c:2362 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 5: 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 ops_free net/core/net_namespace.c:132 [inline] ops_free_list.part.9+0x1b4/0x2c0 net/core/net_namespace.c:154 ops_free_list net/core/net_namespace.c:152 [inline] cleanup_net+0x420/0x7f0 net/core/net_namespace.c:488 process_one_work+0x79e/0x16c0 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 ffff8881e6361c40 which belongs to the cache kmalloc-8192 of size 8192 The buggy address is located 2040 bytes inside of 8192-byte region [ffff8881e6361c40, ffff8881e6363c40) The buggy address belongs to the page: page:ffffea000798d800 count:1 mapcount:0 mapping:ffff8881e6361c40 index:0x0 compound_mapcount: 0 flags: 0x17ffe0000008100(slab|head) raw: 017ffe0000008100 ffff8881e6361c40 0000000000000000 0000000100000001 raw: ffffea0007964520 ffffea0007957e20 ffff8881f6002080 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881e6362300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881e6362380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881e6362400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881e6362480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881e6362500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================