================================================================== BUG: KASAN: use-after-free in sock_net_uid include/net/sock.h:1733 [inline] BUG: KASAN: use-after-free in ip6_route_me_harder+0x9d8/0xc00 net/ipv6/netfilter.c:26 Read of size 4 at addr ffff8801c34d7028 by task syz-executor4/23596 CPU: 0 PID: 23596 Comm: syz-executor4 Not tainted 4.16.0-rc2+ #248 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0x194/0x24d lib/dump_stack.c:53 print_address_description+0x73/0x250 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report+0x23b/0x360 mm/kasan/report.c:412 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 sock_net_uid include/net/sock.h:1733 [inline] ip6_route_me_harder+0x9d8/0xc00 net/ipv6/netfilter.c:26 ip6t_mangle_out net/ipv6/netfilter/ip6table_mangle.c:63 [inline] ip6table_mangle_hook+0x636/0x920 net/ipv6/netfilter/ip6table_mangle.c:77 nf_hook_entry_hookfn include/linux/netfilter.h:120 [inline] nf_hook_slow+0xba/0x1a0 net/netfilter/core.c:483 nf_hook include/linux/netfilter.h:243 [inline] NF_HOOK include/linux/netfilter.h:286 [inline] ip6_xmit+0x10ec/0x2260 net/ipv6/ip6_output.c:277 tcp_v6_send_synack+0x57b/0xaa0 net/ipv6/tcp_ipv6.c:490 tcp_conn_request+0x26fd/0x3660 net/ipv4/tcp_input.c:6335 tcp_v6_conn_request+0x212/0x270 net/ipv6/tcp_ipv6.c:1021 tcp_rcv_state_process+0x92a/0x4760 net/ipv4/tcp_input.c:5842 tcp_v6_do_rcv+0x739/0x1250 net/ipv6/tcp_ipv6.c:1331 tcp_v6_rcv+0x25a0/0x2d40 net/ipv6/tcp_ipv6.c:1521 ip6_input_finish+0x37e/0x17a0 net/ipv6/ip6_input.c:284 NF_HOOK include/linux/netfilter.h:288 [inline] ip6_input+0xdb/0x560 net/ipv6/ip6_input.c:327 dst_input include/net/dst.h:449 [inline] ip6_rcv_finish+0x297/0x8c0 net/ipv6/ip6_input.c:71 NF_HOOK include/linux/netfilter.h:288 [inline] ipv6_rcv+0xf37/0x1fa0 net/ipv6/ip6_input.c:208 __netif_receive_skb_core+0x1a41/0x3460 net/core/dev.c:4554 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4619 process_backlog+0x203/0x740 net/core/dev.c:5299 napi_poll net/core/dev.c:5697 [inline] net_rx_action+0x792/0x1910 net/core/dev.c:5763 __do_softirq+0x2d7/0xb85 kernel/softirq.c:285 do_softirq_own_stack+0x2a/0x40 arch/x86/entry/entry_64.S:1011 do_softirq.part.19+0x14d/0x190 kernel/softirq.c:329 do_softirq kernel/softirq.c:177 [inline] __local_bh_enable_ip+0x1ee/0x230 kernel/softirq.c:182 local_bh_enable include/linux/bottom_half.h:32 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:726 [inline] ip6_finish_output2+0xba0/0x23d0 net/ipv6/ip6_output.c:121 ip6_finish_output+0x69b/0xaf0 net/ipv6/ip6_output.c:154 NF_HOOK_COND include/linux/netfilter.h:277 [inline] ip6_output+0x1eb/0x840 net/ipv6/ip6_output.c:171 dst_output include/net/dst.h:443 [inline] NF_HOOK include/linux/netfilter.h:288 [inline] ip6_xmit+0xe1f/0x2260 net/ipv6/ip6_output.c:277 inet6_csk_xmit+0x2fc/0x580 net/ipv6/inet6_connection_sock.c:139 tcp_transmit_skb+0x1b12/0x3960 net/ipv4/tcp_output.c:1176 tcp_send_syn_data net/ipv4/tcp_output.c:3460 [inline] tcp_connect+0x1f45/0x40f0 net/ipv4/tcp_output.c:3499 tcp_v6_connect+0x2083/0x26c0 net/ipv6/tcp_ipv6.c:306 __inet_stream_connect+0x2d4/0xf00 net/ipv4/af_inet.c:620 tcp_sendmsg_fastopen net/ipv4/tcp.c:1152 [inline] tcp_sendmsg_locked+0x25ca/0x3960 net/ipv4/tcp.c:1198 tcp_sendmsg+0x2f/0x50 net/ipv4/tcp.c:1436 inet_sendmsg+0x11f/0x5e0 net/ipv4/af_inet.c:763 sock_sendmsg_nosec net/socket.c:629 [inline] sock_sendmsg+0xca/0x110 net/socket.c:639 SYSC_sendto+0x361/0x5c0 net/socket.c:1748 SyS_sendto+0x40/0x50 net/socket.c:1716 do_syscall_64+0x280/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x453d69 RSP: 002b:00007fabecdd7c68 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007fabecdd86d4 RCX: 0000000000453d69 RDX: 00000000fffffde5 RSI: 0000000020c7a000 RDI: 0000000000000013 RBP: 000000000072bf58 R08: 00000000205f0fe4 R09: 000000000000001c R10: 0000000020000004 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000004cb R14: 00000000006f73a8 R15: 0000000000000001 Allocated by task 21211: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:552 kmem_cache_alloc_trace+0x136/0x740 mm/slab.c:3607 kmalloc include/linux/slab.h:512 [inline] kzalloc include/linux/slab.h:701 [inline] sctp_add_bind_addr+0xd8/0x460 net/sctp/bind_addr.c:159 sctp_copy_local_addr_list+0x4bb/0x5e0 net/sctp/protocol.c:230 sctp_copy_one_addr+0xdc/0x120 net/sctp/bind_addr.c:449 sctp_bind_addr_copy+0x167/0x360 net/sctp/bind_addr.c:71 sctp_assoc_set_bind_addr_from_ep+0x136/0x190 net/sctp/associola.c:1578 sctp_sendmsg+0x1d98/0x35e0 net/sctp/socket.c:1853 inet_sendmsg+0x11f/0x5e0 net/ipv4/af_inet.c:763 sock_sendmsg_nosec net/socket.c:629 [inline] sock_sendmsg+0xca/0x110 net/socket.c:639 SYSC_sendto+0x361/0x5c0 net/socket.c:1748 SyS_sendto+0x40/0x50 net/socket.c:1716 do_syscall_64+0x280/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 21211: save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527 __cache_free mm/slab.c:3485 [inline] kfree+0xd9/0x260 mm/slab.c:3800 __rcu_reclaim kernel/rcu/rcu.h:167 [inline] rcu_do_batch kernel/rcu/tree.c:2674 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2933 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2900 [inline] rcu_process_callbacks+0xe94/0x17f0 kernel/rcu/tree.c:2917 __do_softirq+0x2d7/0xb85 kernel/softirq.c:285 The buggy address belongs to the object at ffff8801c34d7000 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 40 bytes inside of 64-byte region [ffff8801c34d7000, ffff8801c34d7040) The buggy address belongs to the page: page:ffffea00070d35c0 count:1 mapcount:0 mapping:ffff8801c34d7000 index:0xffff8801c34d7e80 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffff8801c34d7000 ffff8801c34d7e80 000000010000001d raw: ffffea0006d6fde0 ffffea00070a62e0 ffff8801dac00340 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801c34d6f00: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc ffff8801c34d6f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801c34d7000: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff8801c34d7080: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8801c34d7100: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================