================================================================== BUG: KASAN: use-after-free in __write_once_size include/linux/compiler.h:220 [inline] BUG: KASAN: use-after-free in __hlist_del include/linux/list.h:713 [inline] BUG: KASAN: use-after-free in hlist_del_rcu include/linux/rculist.h:455 [inline] BUG: KASAN: use-after-free in __xfrm_policy_unlink+0x4b1/0x5c0 net/xfrm/xfrm_policy.c:2216 Write of size 8 at addr ffff8880aa593780 by task syz-executor.0/29868 CPU: 1 PID: 29868 Comm: syz-executor.0 Not tainted 5.1.0+ #5 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+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:188 __kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 kasan_report+0x12/0x20 mm/kasan/common.c:614 __asan_report_store8_noabort+0x17/0x20 mm/kasan/generic_report.c:137 __write_once_size include/linux/compiler.h:220 [inline] __hlist_del include/linux/list.h:713 [inline] hlist_del_rcu include/linux/rculist.h:455 [inline] __xfrm_policy_unlink+0x4b1/0x5c0 net/xfrm/xfrm_policy.c:2216 xfrm_policy_flush+0x331/0x460 net/xfrm/xfrm_policy.c:1793 pfkey_spdflush+0xb0/0x290 net/key/af_key.c:2777 pfkey_process+0x6d2/0x810 net/key/af_key.c:2836 pfkey_sendmsg+0x40b/0xbe0 net/key/af_key.c:3675 sock_sendmsg_nosec net/socket.c:660 [inline] sock_sendmsg+0x12e/0x170 net/socket.c:671 ___sys_sendmsg+0x81d/0x960 net/socket.c:2292 __sys_sendmsg+0x105/0x1d0 net/socket.c:2330 __do_sys_sendmsg net/socket.c:2339 [inline] __se_sys_sendmsg net/socket.c:2337 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2337 do_syscall_64+0x103/0x670 arch/x86/entry/common.c:298 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x458da9 Code: ad b8 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 b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f8db24d3c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000458da9 RDX: 0000000000000000 RSI: 0000000020000400 RDI: 0000000000000005 RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f8db24d46d4 R13: 00000000004c6751 R14: 00000000004db318 R15: 00000000ffffffff Allocated by task 7905: save_stack+0x23/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_kmalloc mm/kasan/common.c:489 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:462 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:503 kmem_cache_alloc_node_trace+0x153/0x720 mm/slab.c:3630 kmalloc_node include/linux/slab.h:585 [inline] kzalloc_node include/linux/slab.h:753 [inline] __get_vm_area_node+0x12b/0x3a0 mm/vmalloc.c:1401 __vmalloc_node_range+0xd4/0x790 mm/vmalloc.c:1840 __vmalloc_node mm/vmalloc.c:1900 [inline] __vmalloc_node_flags mm/vmalloc.c:1914 [inline] vzalloc+0x6b/0x90 mm/vmalloc.c:1959 alloc_counters.isra.0+0x53/0x690 net/ipv6/netfilter/ip6_tables.c:819 copy_entries_to_user net/ipv4/netfilter/arp_tables.c:674 [inline] get_entries net/ipv4/netfilter/arp_tables.c:861 [inline] do_arpt_get_ctl+0x4a0/0x820 net/ipv4/netfilter/arp_tables.c:1482 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline] nf_getsockopt+0x80/0xe0 net/netfilter/nf_sockopt.c:122 ip_getsockopt net/ipv4/ip_sockglue.c:1574 [inline] ip_getsockopt+0x176/0x1d0 net/ipv4/ip_sockglue.c:1554 tcp_getsockopt net/ipv4/tcp.c:3623 [inline] tcp_getsockopt+0x95/0xf0 net/ipv4/tcp.c:3617 sock_common_getsockopt+0x9a/0xe0 net/core/sock.c:3089 __sys_getsockopt+0x168/0x250 net/socket.c:2115 __do_sys_getsockopt net/socket.c:2126 [inline] __se_sys_getsockopt net/socket.c:2123 [inline] __x64_sys_getsockopt+0xbe/0x150 net/socket.c:2123 do_syscall_64+0x103/0x670 arch/x86/entry/common.c:298 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 7905: save_stack+0x23/0x90 mm/kasan/common.c:71 set_track mm/kasan/common.c:79 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:451 kasan_slab_free+0xe/0x10 mm/kasan/common.c:459 __cache_free mm/slab.c:3463 [inline] kfree+0xcf/0x230 mm/slab.c:3786 __vunmap+0x704/0x9c0 mm/vmalloc.c:1617 __vfree+0x41/0xd0 mm/vmalloc.c:1658 vfree+0x5f/0x90 mm/vmalloc.c:1688 copy_entries_to_user net/ipv4/netfilter/arp_tables.c:706 [inline] get_entries net/ipv4/netfilter/arp_tables.c:861 [inline] do_arpt_get_ctl+0x67b/0x820 net/ipv4/netfilter/arp_tables.c:1482 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline] nf_getsockopt+0x80/0xe0 net/netfilter/nf_sockopt.c:122 ip_getsockopt net/ipv4/ip_sockglue.c:1574 [inline] ip_getsockopt+0x176/0x1d0 net/ipv4/ip_sockglue.c:1554 tcp_getsockopt net/ipv4/tcp.c:3623 [inline] tcp_getsockopt+0x95/0xf0 net/ipv4/tcp.c:3617 sock_common_getsockopt+0x9a/0xe0 net/core/sock.c:3089 __sys_getsockopt+0x168/0x250 net/socket.c:2115 __do_sys_getsockopt net/socket.c:2126 [inline] __se_sys_getsockopt net/socket.c:2123 [inline] __x64_sys_getsockopt+0xbe/0x150 net/socket.c:2123 do_syscall_64+0x103/0x670 arch/x86/entry/common.c:298 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880aa593780 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff8880aa593780, ffff8880aa5937c0) The buggy address belongs to the page: page:ffffea0002a964c0 count:1 mapcount:0 mapping:ffff8880aa400340 index:0xffff8880aa593980 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea000282c688 ffffea000267f508 ffff8880aa400340 raw: ffff8880aa593980 ffff8880aa593000 000000010000001e 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880aa593680: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ffff8880aa593700: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc >ffff8880aa593780: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8880aa593800: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ffff8880aa593880: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ==================================================================