================================================================== BUG: KASAN: use-after-free in xfrm_policy_insert_inexact_list net/xfrm/xfrm_policy.c:1497 [inline] BUG: KASAN: use-after-free in xfrm_policy_inexact_insert+0xcd1/0xee0 net/xfrm/xfrm_policy.c:1202 Read of size 1 at addr ffff88817448c6d9 by task syz-executor2/22035 CPU: 1 PID: 22035 Comm: syz-executor2 Not tainted 4.20.0-rc7+ #358 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+0x1d3/0x2c6 lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 __asan_report_load1_noabort+0x14/0x20 mm/kasan/report.c:430 xfrm_policy_insert_inexact_list net/xfrm/xfrm_policy.c:1497 [inline] xfrm_policy_inexact_insert+0xcd1/0xee0 net/xfrm/xfrm_policy.c:1202 xfrm_policy_insert+0x639/0x850 net/xfrm/xfrm_policy.c:1570 xfrm_add_policy+0x2a0/0x6f0 net/xfrm/xfrm_user.c:1657 xfrm_user_rcv_msg+0x44c/0x8e0 net/xfrm/xfrm_user.c:2663 netlink_rcv_skb+0x16c/0x430 net/netlink/af_netlink.c:2477 xfrm_netlink_rcv+0x6f/0x90 net/xfrm/xfrm_user.c:2671 netlink_unicast_kernel net/netlink/af_netlink.c:1310 [inline] netlink_unicast+0x59f/0x750 net/netlink/af_netlink.c:1336 netlink_sendmsg+0xa18/0xfc0 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:631 ___sys_sendmsg+0x7fd/0x930 net/socket.c:2116 __sys_sendmsg+0x11d/0x280 net/socket.c:2154 __do_sys_sendmsg net/socket.c:2163 [inline] __se_sys_sendmsg net/socket.c:2161 [inline] __x64_sys_sendmsg+0x78/0xb0 net/socket.c:2161 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457669 Code: fd b3 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 b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fadac59cc78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457669 RDX: 0000000000000000 RSI: 000000002014f000 RDI: 0000000000000005 RBP: 000000000072bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fadac59d6d4 R13: 00000000004c44d8 R14: 00000000004d74e8 R15: 00000000ffffffff Allocated by task 6037: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 __do_kmalloc_node mm/slab.c:3684 [inline] __kmalloc_node_track_caller+0x50/0x70 mm/slab.c:3698 __kmalloc_reserve.isra.40+0x41/0xe0 net/core/skbuff.c:140 __alloc_skb+0x155/0x760 net/core/skbuff.c:208 alloc_skb_fclone include/linux/skbuff.h:1053 [inline] sk_stream_alloc_skb+0x141/0x970 net/ipv4/tcp.c:874 tcp_fragment+0x1b7/0x11a0 net/ipv4/tcp_output.c:1307 tso_fragment net/ipv4/tcp_output.c:1860 [inline] tcp_write_xmit+0xff5/0x5bc0 net/ipv4/tcp_output.c:2394 __tcp_push_pending_frames+0xb2/0x340 net/ipv4/tcp_output.c:2577 tcp_push+0x665/0x900 net/ipv4/tcp.c:735 tcp_sendmsg_locked+0x323f/0x3f30 net/ipv4/tcp.c:1406 tcp_sendmsg+0x2f/0x50 net/ipv4/tcp.c:1443 inet_sendmsg+0x1a1/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:631 sock_write_iter+0x35e/0x5c0 net/socket.c:900 call_write_iter include/linux/fs.h:1857 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x6b8/0x9f0 fs/read_write.c:487 vfs_write+0x1fc/0x560 fs/read_write.c:549 ksys_write+0x101/0x260 fs/read_write.c:598 __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:607 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 6037: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3817 skb_free_head+0x93/0xb0 net/core/skbuff.c:553 skb_release_data+0x706/0x990 net/core/skbuff.c:573 skb_release_all+0x4a/0x60 net/core/skbuff.c:627 __kfree_skb+0x15/0x20 net/core/skbuff.c:641 sk_wmem_free_skb include/net/sock.h:1458 [inline] tcp_rtx_queue_unlink_and_free include/net/tcp.h:1762 [inline] tcp_clean_rtx_queue net/ipv4/tcp_input.c:3141 [inline] tcp_ack+0x1eb0/0x58a0 net/ipv4/tcp_input.c:3668 tcp_rcv_established+0x1a77/0x2250 net/ipv4/tcp_input.c:5573 tcp_v4_do_rcv+0x62f/0x8e0 net/ipv4/tcp_ipv4.c:1538 sk_backlog_rcv include/net/sock.h:932 [inline] __release_sock+0x12f/0x390 net/core/sock.c:2284 release_sock+0xad/0x2c0 net/core/sock.c:2797 tcp_sendmsg+0x3a/0x50 net/ipv4/tcp.c:1444 inet_sendmsg+0x1a1/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:631 sock_write_iter+0x35e/0x5c0 net/socket.c:900 call_write_iter include/linux/fs.h:1857 [inline] new_sync_write fs/read_write.c:474 [inline] __vfs_write+0x6b8/0x9f0 fs/read_write.c:487 vfs_write+0x1fc/0x560 fs/read_write.c:549 ksys_write+0x101/0x260 fs/read_write.c:598 __do_sys_write fs/read_write.c:610 [inline] __se_sys_write fs/read_write.c:607 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:607 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88817448c4c0 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 537 bytes inside of 1024-byte region [ffff88817448c4c0, ffff88817448c8c0) The buggy address belongs to the page: page:ffffea0005d12300 count:1 mapcount:0 mapping:ffff8881da800ac0 index:0xffff88817448d6c0 compound_mapcount: 0 flags: 0x2fffc0000010200(slab|head) raw: 02fffc0000010200 ffffea0007069188 ffffea0007228088 ffff8881da800ac0 raw: ffff88817448d6c0 ffff88817448c040 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88817448c580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88817448c600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88817448c680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88817448c700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88817448c780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================