================================================================== BUG: KASAN: use-after-free in __write_once_size include/linux/compiler.h:221 [inline] BUG: KASAN: use-after-free in __hlist_del include/linux/list.h:748 [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:2217 Write of size 8 at addr ffff8880a0e30000 by task syz-executor.0/26987 CPU: 1 PID: 26987 Comm: syz-executor.0 Not tainted 5.2.0-rc5+ #46 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:221 [inline] __hlist_del include/linux/list.h:748 [inline] hlist_del_rcu include/linux/rculist.h:455 [inline] __xfrm_policy_unlink+0x4b1/0x5c0 net/xfrm/xfrm_policy.c:2217 xfrm_policy_flush+0x331/0x460 net/xfrm/xfrm_policy.c:1794 xfrm_flush_policy+0x166/0x300 net/xfrm/xfrm_user.c:2123 xfrm_user_rcv_msg+0x459/0x770 net/xfrm/xfrm_user.c:2657 netlink_rcv_skb+0x177/0x450 net/netlink/af_netlink.c:2477 xfrm_netlink_rcv+0x70/0x90 net/xfrm/xfrm_user.c:2665 netlink_unicast_kernel net/netlink/af_netlink.c:1302 [inline] netlink_unicast+0x531/0x710 net/netlink/af_netlink.c:1328 netlink_sendmsg+0x8ae/0xd70 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:646 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:665 ___sys_sendmsg+0x803/0x920 net/socket.c:2286 __sys_sendmsg+0x105/0x1d0 net/socket.c:2324 __do_sys_sendmsg net/socket.c:2333 [inline] __se_sys_sendmsg net/socket.c:2331 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2331 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459519 Code: fd b7 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 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fa696a44c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000459519 RDX: 0000000000040000 RSI: 0000000020000580 RDI: 0000000000000003 RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fa696a456d4 R13: 00000000004c7264 R14: 00000000004dc6c8 R15: 00000000ffffffff Allocated by task 26817: 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 __do_kmalloc mm/slab.c:3660 [inline] __kmalloc+0x15c/0x740 mm/slab.c:3669 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:742 [inline] tomoyo_encode2.part.0+0xf5/0x400 security/tomoyo/realpath.c:44 tomoyo_encode2 security/tomoyo/realpath.c:30 [inline] tomoyo_encode+0x2b/0x50 security/tomoyo/realpath.c:79 tomoyo_realpath_from_path+0x1d3/0x7a0 security/tomoyo/realpath.c:316 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x230/0x430 security/tomoyo/file.c:822 tomoyo_inode_getattr+0x1d/0x30 security/tomoyo/tomoyo.c:129 security_inode_getattr+0xf2/0x150 security/security.c:1179 vfs_getattr+0x25/0x70 fs/stat.c:115 vfs_statx_fd+0x71/0xc0 fs/stat.c:145 vfs_fstat include/linux/fs.h:3209 [inline] __do_sys_newfstat+0x9b/0x120 fs/stat.c:378 __se_sys_newfstat fs/stat.c:375 [inline] __x64_sys_newfstat+0x54/0x80 fs/stat.c:375 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 26817: 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:3432 [inline] kfree+0xcf/0x220 mm/slab.c:3755 tomoyo_path_perm+0x24e/0x430 security/tomoyo/file.c:842 tomoyo_inode_getattr+0x1d/0x30 security/tomoyo/tomoyo.c:129 security_inode_getattr+0xf2/0x150 security/security.c:1179 vfs_getattr+0x25/0x70 fs/stat.c:115 vfs_statx_fd+0x71/0xc0 fs/stat.c:145 vfs_fstat include/linux/fs.h:3209 [inline] __do_sys_newfstat+0x9b/0x120 fs/stat.c:378 __se_sys_newfstat fs/stat.c:375 [inline] __x64_sys_newfstat+0x54/0x80 fs/stat.c:375 do_syscall_64+0xfd/0x680 arch/x86/entry/common.c:301 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880a0e30000 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff8880a0e30000, ffff8880a0e30040) The buggy address belongs to the page: page:ffffea0002838c00 refcount:1 mapcount:0 mapping:ffff8880aa400340 index:0xffff8880a0e30180 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea00022b0e48 ffffea0002361808 ffff8880aa400340 raw: ffff8880a0e30180 ffff8880a0e30000 000000010000001a 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a0e2ff00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880a0e2ff80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880a0e30000: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8880a0e30080: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff8880a0e30100: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ==================================================================