================================================================== BUG: KASAN: use-after-free in decode_session6+0xe7c/0x1580 net/xfrm/xfrm_policy.c:3393 Read of size 1 at addr ffff88809de4dd74 by task syz-executor.2/15350 CPU: 1 PID: 15350 Comm: syz-executor.2 Not tainted 5.10.0-rc2-syzkaller #0 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+0x107/0x163 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x4c8 mm/kasan/report.c:385 __kasan_report mm/kasan/report.c:545 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:562 decode_session6+0xe7c/0x1580 net/xfrm/xfrm_policy.c:3393 __xfrm_decode_session+0x50/0xb0 net/xfrm/xfrm_policy.c:3485 xfrm_decode_session include/net/xfrm.h:1137 [inline] vti6_tnl_xmit+0x40d/0x1cd0 net/ipv6/ip6_vti.c:576 __netdev_start_xmit include/linux/netdevice.h:4745 [inline] netdev_start_xmit include/linux/netdevice.h:4759 [inline] xmit_one net/core/dev.c:3564 [inline] dev_hard_start_xmit+0x1eb/0x920 net/core/dev.c:3580 sch_direct_xmit+0x2e1/0xbd0 net/sched/sch_generic.c:313 qdisc_restart net/sched/sch_generic.c:376 [inline] __qdisc_run+0x4ba/0x15e0 net/sched/sch_generic.c:384 __dev_xmit_skb net/core/dev.c:3803 [inline] __dev_queue_xmit+0x19fa/0x2da0 net/core/dev.c:4108 neigh_connected_output+0x380/0x4c0 net/core/neighbour.c:1518 neigh_output include/net/neighbour.h:509 [inline] ip6_finish_output2+0x6b8/0x16c0 net/ipv6/ip6_output.c:117 __ip6_finish_output net/ipv6/ip6_output.c:143 [inline] __ip6_finish_output+0x447/0xab0 net/ipv6/ip6_output.c:128 ip6_finish_output+0x34/0x1f0 net/ipv6/ip6_output.c:153 NF_HOOK_COND include/linux/netfilter.h:290 [inline] ip6_output+0x1db/0x520 net/ipv6/ip6_output.c:176 dst_output include/net/dst.h:441 [inline] ip6_local_out+0xaf/0x1a0 net/ipv6/output_core.c:179 ip6_send_skb+0xb7/0x340 net/ipv6/ip6_output.c:1865 udp_v6_send_skb+0x7c2/0x15d0 net/ipv6/udp.c:1236 udpv6_sendmsg+0x2300/0x2bd0 net/ipv6/udp.c:1534 inet6_sendmsg+0x99/0xe0 net/ipv6/af_inet6.c:638 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:671 ____sys_sendmsg+0x331/0x810 net/socket.c:2353 ___sys_sendmsg+0xf3/0x170 net/socket.c:2407 __sys_sendmmsg+0x195/0x470 net/socket.c:2497 __do_sys_sendmmsg net/socket.c:2526 [inline] __se_sys_sendmmsg net/socket.c:2523 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2523 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45deb9 Code: 0d b4 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 db b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f471eed6c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 0000000000028040 RCX: 000000000045deb9 RDX: 0000000000000002 RSI: 0000000020007700 RDI: 0000000000000003 RBP: 000000000118c010 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bfd4 R13: 00007ffeaa330cef R14: 00007f471eed79c0 R15: 000000000118bfd4 Allocated by task 11244: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:461 slab_post_alloc_hook mm/slab.h:526 [inline] slab_alloc_node mm/slub.c:2891 [inline] slab_alloc mm/slub.c:2899 [inline] kmem_cache_alloc+0x117/0x460 mm/slub.c:2904 kmem_cache_zalloc include/linux/slab.h:654 [inline] locks_alloc_lock fs/locks.c:346 [inline] flock_lock_inode+0x16b/0x1100 fs/locks.c:1076 flock_lock_inode_wait fs/locks.c:2169 [inline] locks_lock_inode_wait+0x139/0x400 fs/locks.c:2196 locks_lock_file_wait include/linux/fs.h:1311 [inline] __do_sys_flock fs/locks.c:2259 [inline] __se_sys_flock fs/locks.c:2222 [inline] __x64_sys_flock+0x2f1/0x360 fs/locks.c:2222 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 11244: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0x102/0x140 mm/kasan/common.c:422 slab_free_hook mm/slub.c:1544 [inline] slab_free_freelist_hook+0x5d/0x150 mm/slub.c:1577 slab_free mm/slub.c:3142 [inline] kmem_cache_free+0x82/0x350 mm/slub.c:3158 locks_free_lock fs/locks.c:383 [inline] locks_dispose_list+0x123/0x1d0 fs/locks.c:395 flock_lock_inode+0xa30/0x1100 fs/locks.c:1126 locks_remove_flock+0x2b6/0x300 fs/locks.c:2750 locks_remove_file+0xd3/0x560 fs/locks.c:2792 __fput+0x1b8/0x920 fs/file_table.c:273 task_work_run+0xdd/0x190 kernel/task_work.c:151 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:164 [inline] exit_to_user_mode_prepare+0x17e/0x1a0 kernel/entry/common.c:191 syscall_exit_to_user_mode+0x38/0x260 kernel/entry/common.c:266 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88809de4dd20 which belongs to the cache file_lock_cache of size 272 The buggy address is located 84 bytes inside of 272-byte region [ffff88809de4dd20, ffff88809de4de30) The buggy address belongs to the page: page:00000000bb294a81 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x9de4d flags: 0xfff00000000200(slab) raw: 00fff00000000200 ffffea0001a0b180 0000000600000006 ffff888010f273c0 raw: 0000000000000000 00000000000c000c 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809de4dc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809de4dc80: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc >ffff88809de4dd00: fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809de4dd80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809de4de00: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fa fb ==================================================================