================================================================== 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 ffff888093ccf29c by task syz-executor.0/15605 CPU: 1 PID: 15605 Comm: syz-executor.0 Not tainted 5.9.0-rc4-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_send_syn_data net/ipv4/tcp_output.c:3646 [inline] tcp_connect+0x1584/0x2480 net/ipv4/tcp_output.c:3685 tcp_v4_connect+0x10eb/0x1be0 net/ipv4/tcp_ipv4.c:312 __inet_stream_connect+0x93d/0xc20 net/ipv4/af_inet.c:661 tcp_sendmsg_fastopen net/ipv4/tcp.c:1172 [inline] tcp_sendmsg_locked+0x3900/0x3ed0 net/ipv4/tcp.c:1214 tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1441 sock_sendmsg_nosec net/socket.c:651 [inline] sock_sendmsg net/socket.c:671 [inline] __sys_sendto+0x42a/0x5c0 net/socket.c:1992 __do_sys_sendto net/socket.c:2004 [inline] __se_sys_sendto net/socket.c:2000 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2000 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:00007fd0ca466c78 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 000000000002d140 RCX: 000000000045d5b9 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 000000000118cf98 R08: 00000000200008c0 R09: 0000000000000010 R10: 00000000200007fd R11: 0000000000000246 R12: 000000000118cf4c R13: 00007ffe7d3f11ef R14: 00007fd0ca4679c0 R15: 000000000118cf4c Allocated by task 15605: 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 26: 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 ffff888093ccf280 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 28 bytes inside of 64-byte region [ffff888093ccf280, ffff888093ccf2c0) The buggy address belongs to the page: page:000000003315a305 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x93ccf flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea0002839d48 ffffea0002485708 ffff8880aa440200 raw: 0000000000000000 ffff888093ccf000 0000000100000020 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888093ccf180: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff888093ccf200: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc >ffff888093ccf280: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff888093ccf300: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ffff888093ccf380: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================