netlink: 24 bytes leftover after parsing attributes in process `syz-executor.0'. ================================================================== BUG: KASAN: use-after-free in net_generic include/net/netns/generic.h:46 [inline] BUG: KASAN: use-after-free in xfrm6_tunnel_pernet net/ipv6/xfrm6_tunnel.c:50 [inline] BUG: KASAN: use-after-free in xfrm6_tunnel_free_spi net/ipv6/xfrm6_tunnel.c:202 [inline] BUG: KASAN: use-after-free in xfrm6_tunnel_destroy+0x4c3/0x560 net/ipv6/xfrm6_tunnel.c:303 Read of size 8 at addr ffff8880a0b32f38 by task kworker/1:0/28540 CPU: 1 PID: 28540 Comm: kworker/1:0 Not tainted 4.14.191-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+0x1b2/0x283 lib/dump_stack.c:58 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252 kasan_report_error.cold+0x8a/0x194 mm/kasan/report.c:351 kasan_report mm/kasan/report.c:409 [inline] __asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430 net_generic include/net/netns/generic.h:46 [inline] xfrm6_tunnel_pernet net/ipv6/xfrm6_tunnel.c:50 [inline] xfrm6_tunnel_free_spi net/ipv6/xfrm6_tunnel.c:202 [inline] xfrm6_tunnel_destroy+0x4c3/0x560 net/ipv6/xfrm6_tunnel.c:303 xfrm_state_gc_destroy net/xfrm/xfrm_state.c:449 [inline] xfrm_state_gc_task+0x4ad/0x7e0 net/xfrm/xfrm_state.c:472 process_one_work+0x793/0x14a0 kernel/workqueue.c:2116 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2250 kthread+0x30d/0x420 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 Allocated by task 6383: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551 __do_kmalloc mm/slab.c:3720 [inline] __kmalloc+0x15a/0x400 mm/slab.c:3729 kmalloc include/linux/slab.h:493 [inline] kzalloc include/linux/slab.h:661 [inline] net_alloc_generic+0x1f/0x70 net/core/net_namespace.c:57 net_alloc net/core/net_namespace.c:358 [inline] copy_net_ns+0xd5/0x440 net/core/net_namespace.c:402 create_new_namespaces+0x375/0x720 kernel/nsproxy.c:107 unshare_nsproxy_namespaces+0xa1/0x1d0 kernel/nsproxy.c:206 SYSC_unshare kernel/fork.c:2391 [inline] SyS_unshare+0x308/0x7f0 kernel/fork.c:2341 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb Freed by task 22: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xc9/0x250 mm/slab.c:3815 net_free net/core/net_namespace.c:377 [inline] net_drop_ns+0x54/0x70 net/core/net_namespace.c:385 cleanup_net+0x526/0x840 net/core/net_namespace.c:502 process_one_work+0x793/0x14a0 kernel/workqueue.c:2116 worker_thread+0x5cc/0xff0 kernel/workqueue.c:2250 kthread+0x30d/0x420 kernel/kthread.c:232 ret_from_fork+0x24/0x30 arch/x86/entry/entry_64.S:404 The buggy address belongs to the object at ffff8880a0b32dc0 which belongs to the cache kmalloc-1024 of size 1024 The buggy address is located 376 bytes inside of 1024-byte region [ffff8880a0b32dc0, ffff8880a0b331c0) The buggy address belongs to the page: page:ffffea000282cc80 count:1 mapcount:0 mapping:ffff8880a0b32040 index:0xffff8880a0b32940 compound_mapcount: 0 flags: 0xfffe0000008100(slab|head) raw: 00fffe0000008100 ffff8880a0b32040 ffff8880a0b32940 0000000100000006 raw: ffffea00024619a0 ffffea0002852220 ffff88812fe52ac0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a0b32e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a0b32e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a0b32f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a0b32f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a0b33000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================