netlink: 31 bytes leftover after parsing attributes in process `syz-executor.1'. ================================================================== 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:702 [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:2212 Write of size 8 at addr ffff888099a21f80 by task syz-executor.1/27629 CPU: 1 PID: 27629 Comm: syz-executor.1 Not tainted 5.0.0-rc7+ #105 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:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 __asan_report_store8_noabort+0x17/0x20 mm/kasan/generic_report.c:140 __write_once_size include/linux/compiler.h:220 [inline] __hlist_del include/linux/list.h:702 [inline] hlist_del_rcu include/linux/rculist.h:455 [inline] __xfrm_policy_unlink+0x4b1/0x5c0 net/xfrm/xfrm_policy.c:2212 xfrm_policy_flush+0x331/0x460 net/xfrm/xfrm_policy.c:1789 xfrm_flush_policy+0x166/0x300 net/xfrm/xfrm_user.c:2134 xfrm_user_rcv_msg+0x458/0x770 net/xfrm/xfrm_user.c:2668 netlink_rcv_skb+0x17a/0x460 net/netlink/af_netlink.c:2477 xfrm_netlink_rcv+0x70/0x90 net/xfrm/xfrm_user.c:2676 netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline] netlink_unicast+0x536/0x720 net/netlink/af_netlink.c:1336 netlink_sendmsg+0x8ae/0xd70 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xdd/0x130 net/socket.c:632 ___sys_sendmsg+0x3e2/0x930 net/socket.c:2115 __sys_sendmmsg+0x1c3/0x4e0 net/socket.c:2210 __do_sys_sendmmsg net/socket.c:2239 [inline] __se_sys_sendmmsg net/socket.c:2236 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2236 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457e29 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:00007f2e49707c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000457e29 RDX: 0492492492492805 RSI: 0000000020000140 RDI: 0000000000000004 RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f2e497086d4 R13: 00000000004c4de0 R14: 00000000004d8b28 R15: 00000000ffffffff Allocated by task 27108: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_kmalloc mm/kasan/common.c:495 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:468 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:509 __do_kmalloc mm/slab.c:3716 [inline] __kmalloc+0x15c/0x740 mm/slab.c:3725 kmalloc include/linux/slab.h:550 [inline] kzalloc include/linux/slab.h:740 [inline] ext4_htree_store_dirent+0x8a/0x650 fs/ext4/dir.c:452 htree_dirblock_to_tree+0x2d2/0x660 fs/ext4/namei.c:1021 ext4_htree_fill_tree+0x252/0xa50 fs/ext4/namei.c:1098 ext4_dx_readdir fs/ext4/dir.c:576 [inline] ext4_readdir+0x16bb/0x30f0 fs/ext4/dir.c:121 iterate_dir+0x489/0x5f0 fs/readdir.c:51 __do_sys_getdents fs/readdir.c:231 [inline] __se_sys_getdents fs/readdir.c:212 [inline] __x64_sys_getdents+0x1dd/0x370 fs/readdir.c:212 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 27108: save_stack+0x45/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:457 kasan_slab_free+0xe/0x10 mm/kasan/common.c:465 __cache_free mm/slab.c:3494 [inline] kfree+0xcf/0x230 mm/slab.c:3811 free_rb_tree_fname+0x87/0xe0 fs/ext4/dir.c:404 ext4_htree_free_dir_info fs/ext4/dir.c:426 [inline] ext4_release_dir+0x46/0x70 fs/ext4/dir.c:624 __fput+0x2df/0x8d0 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x14a/0x1c0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x273/0x2c0 arch/x86/entry/common.c:166 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x52d/0x610 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff888099a21f80 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff888099a21f80, ffff888099a21fc0) The buggy address belongs to the page: page:ffffea0002668840 count:1 mapcount:0 mapping:ffff88812c3f0340 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea00029fa688 ffffea0002902688 ffff88812c3f0340 raw: 0000000000000000 ffff888099a21000 0000000100000020 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888099a21e80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff888099a21f00: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff888099a21f80: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff888099a22000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888099a22080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================