================================================================== BUG: KASAN: use-after-free in inet_csk_route_child_sock+0xab9/0xae0 net/ipv4/inet_connection_sock.c:647 Read of size 1 at addr ffff88808e8b221c by task syz-executor.1/1343 CPU: 0 PID: 1343 Comm: syz-executor.1 Not tainted 5.10.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+0x137/0x1be lib/dump_stack.c:118 print_address_description+0x6c/0x660 mm/kasan/report.c:385 __kasan_report mm/kasan/report.c:545 [inline] kasan_report+0x136/0x1e0 mm/kasan/report.c:562 inet_csk_route_child_sock+0xab9/0xae0 net/ipv4/inet_connection_sock.c:647 tcp_v4_syn_recv_sock+0x7a9/0x11a0 net/ipv4/tcp_ipv4.c:1543 tcp_v6_syn_recv_sock+0xa6/0x1a80 net/ipv6/tcp_ipv6.c:1209 tcp_check_req+0xe14/0x17a0 net/ipv4/tcp_minisocks.c:772 tcp_v4_rcv+0x2106/0x4a20 net/ipv4/tcp_ipv4.c:1973 ip_protocol_deliver_rcu+0x3ca/0x790 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:5315 [inline] __netif_receive_skb+0x128/0x3b0 net/core/dev.c:5429 process_backlog+0x4b8/0x910 net/core/dev.c:6319 napi_poll net/core/dev.c:6763 [inline] net_rx_action+0x61e/0x10d0 net/core/dev.c:6833 __do_softirq+0x307/0x6be kernel/softirq.c:298 asm_call_irq_on_stack+0xf/0x20 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline] do_softirq_own_stack+0x9a/0xe0 arch/x86/kernel/irq_64.c:77 do_softirq+0xd1/0x110 kernel/softirq.c:343 __local_bh_enable_ip+0x12d/0x170 kernel/softirq.c:195 __icmp_send+0x1cf3/0x2410 net/ipv4/icmp.c:768 icmp_send include/net/icmp.h:43 [inline] ip_fragment+0x17d/0x210 net/ipv4/ip_output.c:587 ip_finish_output_gso net/ipv4/ip_output.c:281 [inline] __ip_finish_output+0x2b5/0x4b0 net/ipv4/ip_output.c:303 dst_output include/net/dst.h:443 [inline] ip_local_out net/ipv4/ip_output.c:126 [inline] __ip_queue_xmit+0x1096/0x1b00 net/ipv4/ip_output.c:532 __tcp_transmit_skb+0x1be8/0x3100 net/ipv4/tcp_output.c:1404 tcp_transmit_skb net/ipv4/tcp_output.c:1422 [inline] tcp_write_xmit+0x1772/0x78e0 net/ipv4/tcp_output.c:2684 __tcp_push_pending_frames+0x8e/0x260 net/ipv4/tcp_output.c:2862 do_tcp_sendpages+0x143e/0x26d0 net/ipv4/tcp.c:1070 tcp_sendpage_locked net/ipv4/tcp.c:1117 [inline] tcp_sendpage+0xa0/0xc0 net/ipv4/tcp.c:1127 inet_sendpage+0x16b/0x360 net/ipv4/af_inet.c:831 kernel_sendpage+0x2ca/0x370 net/socket.c:3646 sock_sendpage+0x7e/0xb0 net/socket.c:944 pipe_to_sendpage+0x208/0x2d0 fs/splice.c:364 splice_from_pipe_feed fs/splice.c:418 [inline] __splice_from_pipe+0x351/0x8b0 fs/splice.c:562 splice_from_pipe fs/splice.c:597 [inline] generic_splice_sendpage+0x112/0x180 fs/splice.c:743 do_splice_from fs/splice.c:764 [inline] do_splice+0x154d/0x1d00 fs/splice.c:1059 __do_splice fs/splice.c:1137 [inline] __do_sys_splice fs/splice.c:1343 [inline] __se_sys_splice+0x2a0/0x380 fs/splice.c:1325 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:00007f1678cedc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000113 RAX: ffffffffffffffda RBX: 0000000000035140 RCX: 000000000045deb9 RDX: 0000000000000006 RSI: 0000000000000000 RDI: 0000000000000004 RBP: 000000000118bf78 R08: 0000000000010103 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000118bf2c R13: 00007ffcaae6053f R14: 00007f1678cee9c0 R15: 000000000118bf2c Allocated by task 1343: kasan_save_stack mm/kasan/common.c:48 [inline] kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc+0x111/0x140 mm/kasan/common.c:461 __kmalloc+0x17b/0x2a0 mm/slub.c:3970 kmalloc include/linux/slab.h:557 [inline] kzalloc+0x16/0x20 include/linux/slab.h:664 cipso_v4_req_setattr+0x93/0x1a0 net/ipv4/cipso_ipv4.c:1953 netlbl_req_setattr+0x32b/0x490 net/netlabel/netlabel_kapi.c:1200 smack_inet_conn_request+0x57f/0x6b0 security/smack/smack_lsm.c:4191 security_inet_conn_request+0x56/0xb0 security/security.c:2231 tcp_conn_request+0xc45/0x2d20 net/ipv4/tcp_input.c:6805 tcp_rcv_state_process+0x6bf/0x2410 net/ipv4/tcp_input.c:6330 tcp_v4_do_rcv+0x5a3/0x860 net/ipv4/tcp_ipv4.c:1674 tcp_v4_rcv+0x3342/0x4a20 net/ipv4/tcp_ipv4.c:2022 ip_protocol_deliver_rcu+0x3ca/0x790 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:5315 [inline] __netif_receive_skb+0x128/0x3b0 net/core/dev.c:5429 process_backlog+0x4b8/0x910 net/core/dev.c:6319 napi_poll net/core/dev.c:6763 [inline] net_rx_action+0x61e/0x10d0 net/core/dev.c:6833 __do_softirq+0x307/0x6be kernel/softirq.c:298 Freed by task 8216: 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+0x108/0x140 mm/kasan/common.c:422 slab_free_hook mm/slub.c:1544 [inline] slab_free_freelist_hook+0xd6/0x1a0 mm/slub.c:1577 slab_free mm/slub.c:3142 [inline] kfree+0xd1/0x280 mm/slub.c:4124 inet_sock_destruct+0x566/0x740 net/ipv4/af_inet.c:159 __sk_destruct+0x4f/0x840 net/core/sock.c:1759 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+0x13a/0xad0 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:2272 worker_thread+0xaa4/0x1460 kernel/workqueue.c:2418 kthread+0x36b/0x390 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 The buggy address belongs to the object at ffff88808e8b2200 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 28 bytes inside of 64-byte region [ffff88808e8b2200, ffff88808e8b2240) The buggy address belongs to the page: page:0000000018662d83 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88808e8b2b00 pfn:0x8e8b2 flags: 0xfff00000000200(slab) raw: 00fff00000000200 ffffea00008c7580 0000000200000002 ffff8880104418c0 raw: ffff88808e8b2b00 000000008020000f 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88808e8b2100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88808e8b2180: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88808e8b2200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88808e8b2280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88808e8b2300: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================