================================================================== BUG: KASAN: use-after-free in inet_csk_route_child_sock+0xa81/0xaa0 net/ipv4/inet_connection_sock.c:647 Read of size 1 at addr ffff88808e160d1c by task syz-executor.2/16067 CPU: 1 PID: 16067 Comm: syz-executor.2 Not tainted 5.9.0-rc3-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+0x1d6/0x29e lib/dump_stack.c:118 print_address_description+0x66/0x620 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report+0x132/0x1d0 mm/kasan/report.c:530 inet_csk_route_child_sock+0xa81/0xaa0 net/ipv4/inet_connection_sock.c:647 tcp_v4_syn_recv_sock+0x6eb/0x10b0 net/ipv4/tcp_ipv4.c:1533 tcp_v6_syn_recv_sock+0xa3/0x1a30 net/ipv6/tcp_ipv6.c:1204 tcp_check_req+0xe21/0x1710 net/ipv4/tcp_minisocks.c:772 tcp_v4_rcv+0x2105/0x49f0 net/ipv4/tcp_ipv4.c:1963 ip_protocol_deliver_rcu+0x390/0x750 net/ipv4/ip_input.c:204 ip_local_deliver_finish net/ipv4/ip_input.c:231 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ip_local_deliver+0x311/0x490 net/ipv4/ip_input.c:252 __netif_receive_skb_one_core net/core/dev.c:5286 [inline] __netif_receive_skb+0x164/0x3c0 net/core/dev.c:5400 process_backlog+0x578/0xa10 net/core/dev.c:6242 napi_poll net/core/dev.c:6688 [inline] net_rx_action+0x655/0x1200 net/core/dev.c:6758 __do_softirq+0x256/0x6d5 kernel/softirq.c:298 asm_call_on_stack+0xf/0x20 arch/x86/entry/entry_64.S:706 __run_on_irqstack arch/x86/include/asm/irq_stack.h:22 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:48 [inline] do_softirq_own_stack+0x91/0xe0 arch/x86/kernel/irq_64.c:77 do_softirq+0x102/0x150 kernel/softirq.c:343 __local_bh_enable_ip+0x17f/0x1c0 kernel/softirq.c:195 rcu_read_unlock_bh include/linux/rcupdate.h:723 [inline] ip_finish_output2+0x1492/0x18e0 net/ipv4/ip_output.c:229 dst_output include/net/dst.h:443 [inline] ip_local_out net/ipv4/ip_output.c:125 [inline] __ip_queue_xmit+0x104b/0x1a30 net/ipv4/ip_output.c:530 __tcp_transmit_skb+0x1bfd/0x3040 net/ipv4/tcp_output.c:1246 tcp_transmit_skb net/ipv4/tcp_output.c:1264 [inline] tcp_write_xmit+0x16c4/0x7760 net/ipv4/tcp_output.c:2527 do_tcp_sendpages+0x15fd/0x26c0 net/ipv4/tcp.c:1067 tcp_sendpage_locked net/ipv4/tcp.c:1113 [inline] tcp_sendpage+0xa0/0xc0 net/ipv4/tcp.c:1123 inet_sendpage+0x16b/0x360 net/ipv4/af_inet.c:831 kernel_sendpage+0x8b/0xc0 net/socket.c:3642 kcm_write_msgs+0x568/0x1340 net/kcm/kcmsock.c:645 kcm_sendmsg+0x1b1b/0x2130 net/kcm/kcmsock.c:1034 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg net/socket.c:671 [inline] ____sys_sendmsg+0x519/0x800 net/socket.c:2353 ___sys_sendmsg net/socket.c:2407 [inline] __sys_sendmsg+0x2b1/0x360 net/socket.c:2440 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45d5b9 Code: 5d 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 2b b4 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f5f2cbb1c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 000000000002cc00 RCX: 000000000045d5b9 RDX: 0000000000000000 RSI: 0000000020000a80 RDI: 0000000000000003 RBP: 000000000118cf80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118cf4c R13: 00007ffca4ca37ff R14: 00007f5f2cbb29c0 R15: 000000000118cf4c Allocated by task 99: kasan_save_stack mm/kasan/common.c:48 [inline] kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc+0x100/0x130 mm/kasan/common.c:461 __do_kmalloc mm/slab.c:3655 [inline] __kmalloc+0x205/0x300 mm/slab.c:3664 kmalloc include/linux/slab.h:559 [inline] kzalloc+0x16/0x30 include/linux/slab.h:666 cipso_v4_req_setattr+0xa0/0x1b0 net/ipv4/cipso_ipv4.c:1953 netlbl_req_setattr+0x32b/0x490 net/netlabel/netlabel_kapi.c:1200 smack_inet_conn_request+0x7e9/0x980 security/smack/smack_lsm.c:4147 security_inet_conn_request+0x56/0xb0 security/security.c:2215 tcp_conn_request+0xbad/0x27a0 net/ipv4/tcp_input.c:6706 tcp_rcv_state_process+0x699/0x2360 net/ipv4/tcp_input.c:6246 tcp_v4_do_rcv+0x5a5/0x860 net/ipv4/tcp_ipv4.c:1664 tcp_v4_rcv+0x332c/0x49f0 net/ipv4/tcp_ipv4.c:2012 ip_protocol_deliver_rcu+0x390/0x750 net/ipv4/ip_input.c:204 ip_local_deliver_finish net/ipv4/ip_input.c:231 [inline] NF_HOOK include/linux/netfilter.h:301 [inline] ip_local_deliver+0x311/0x490 net/ipv4/ip_input.c:252 __netif_receive_skb_one_core net/core/dev.c:5286 [inline] __netif_receive_skb+0x164/0x3c0 net/core/dev.c:5400 process_backlog+0x578/0xa10 net/core/dev.c:6242 napi_poll net/core/dev.c:6688 [inline] net_rx_action+0x655/0x1200 net/core/dev.c:6758 __do_softirq+0x256/0x6d5 kernel/softirq.c:298 Freed by task 10899: kasan_save_stack mm/kasan/common.c:48 [inline] kasan_set_track+0x3d/0x70 mm/kasan/common.c:56 kasan_set_free_info+0x17/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0xdd/0x110 mm/kasan/common.c:422 __cache_free mm/slab.c:3418 [inline] kfree+0x113/0x200 mm/slab.c:3756 inet_sock_destruct+0x5c7/0x780 net/ipv4/af_inet.c:159 __sk_destruct+0x50/0x770 net/core/sock.c:1778 inet_release+0x16e/0x1f0 net/ipv4/af_inet.c:431 __sock_release net/socket.c:596 [inline] sock_release+0x7a/0x140 net/socket.c:624 rds_tcp_accept_one+0x138/0xae0 net/rds/tcp_listen.c:220 rds_tcp_accept_worker+0x3b/0xa0 net/rds/tcp.c:515 process_one_work+0x789/0xfc0 kernel/workqueue.c:2269 worker_thread+0xaa4/0x1460 kernel/workqueue.c:2415 kthread+0x37e/0x3a0 drivers/block/aoe/aoecmd.c:1234 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 The buggy address belongs to the object at ffff88808e160d00 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 28 bytes inside of 64-byte region [ffff88808e160d00, ffff88808e160d40) The buggy address belongs to the page: page:00000000d3f99a65 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x8e160 flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea00022dcb48 ffffea0002794b08 ffff8880aa440200 raw: 0000000000000000 ffff88808e160000 0000000100000020 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808e160c00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88808e160c80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88808e160d00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88808e160d80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88808e160e00: 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc ==================================================================