================================================================== BUG: KASAN: use-after-free in __list_add_valid+0xc6/0xd0 lib/list_debug.c:26 Read of size 8 at addr ffff8801d0d16658 by task syz-executor1/23896 CPU: 0 PID: 23896 Comm: syz-executor1 Not tainted 4.16.0-rc7+ #374 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+0x23c/0x360 mm/kasan/report.c:412 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433 __list_add_valid+0xc6/0xd0 lib/list_debug.c:26 __list_add include/linux/list.h:60 [inline] list_add_tail include/linux/list.h:93 [inline] cma_listen_on_all drivers/infiniband/core/cma.c:2309 [inline] rdma_listen+0x581/0x8e0 drivers/infiniband/core/cma.c:3333 ucma_listen+0x172/0x1f0 drivers/infiniband/core/ucma.c:1074 ucma_write+0x2d6/0x3d0 drivers/infiniband/core/ucma.c:1656 __vfs_write+0xef/0x970 fs/read_write.c:480 vfs_write+0x189/0x510 fs/read_write.c:544 SYSC_write fs/read_write.c:589 [inline] SyS_write+0xef/0x220 fs/read_write.c:581 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x454e79 RSP: 002b:00007f72f952ec68 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f72f952f6d4 RCX: 0000000000454e79 RDX: 0000000000000010 RSI: 0000000020000000 RDI: 0000000000000016 RBP: 000000000072bea0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff R13: 00000000000006b7 R14: 00000000006fc1c8 R15: 0000000000000000 Allocated by task 23659: 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 __do_kmalloc_node mm/slab.c:3670 [inline] __kmalloc_node_track_caller+0x47/0x70 mm/slab.c:3684 __kmalloc_reserve.isra.39+0x41/0xd0 net/core/skbuff.c:137 __alloc_skb+0x13b/0x780 net/core/skbuff.c:205 alloc_skb include/linux/skbuff.h:983 [inline] tcp_v6_send_response+0x215/0x1c30 net/ipv6/tcp_ipv6.c:799 tcp_v6_send_reset+0x6fe/0xff0 net/ipv6/tcp_ipv6.c:949 tcp_v6_rcv+0x1c56/0x2d70 net/ipv6/tcp_ipv6.c:1543 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+0xf38/0x1fb0 net/ipv6/ip6_input.c:208 __netif_receive_skb_core+0x1a41/0x3460 net/core/dev.c:4562 __netif_receive_skb+0x2c/0x1b0 net/core/dev.c:4627 process_backlog+0x203/0x740 net/core/dev.c:5307 napi_poll net/core/dev.c:5705 [inline] net_rx_action+0x792/0x1910 net/core/dev.c:5771 __do_softirq+0x2d7/0xb85 kernel/softirq.c:285 Freed by task 23659: 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:3486 [inline] kfree+0xd9/0x260 mm/slab.c:3801 skb_free_head+0x74/0xb0 net/core/skbuff.c:550 skb_release_data+0x58c/0x790 net/core/skbuff.c:570 skb_release_all+0x4a/0x60 net/core/skbuff.c:627 __kfree_skb+0x15/0x20 net/core/skbuff.c:641 tcp_drop+0xcf/0x100 net/ipv4/tcp_input.c:4301 tcp_rcv_synsent_state_process net/ipv4/tcp_input.c:5712 [inline] tcp_rcv_state_process+0xb86/0x4920 net/ipv4/tcp_input.c:5850 tcp_v6_do_rcv+0x739/0x1250 net/ipv6/tcp_ipv6.c:1331 sk_backlog_rcv include/net/sock.h:908 [inline] __release_sock+0x124/0x360 net/core/sock.c:2271 release_sock+0xa4/0x2a0 net/core/sock.c:2786 inet_wait_for_connect net/ipv4/af_inet.c:559 [inline] __inet_stream_connect+0x651/0xf00 net/ipv4/af_inet.c:645 tcp_sendmsg_fastopen net/ipv4/tcp.c:1168 [inline] tcp_sendmsg_locked+0x264e/0x3c70 net/ipv4/tcp.c:1214 tcp_sendmsg+0x2f/0x50 net/ipv4/tcp.c:1463 inet_sendmsg+0x11f/0x5e0 net/ipv4/af_inet.c:764 sock_sendmsg_nosec net/socket.c:630 [inline] sock_sendmsg+0xca/0x110 net/socket.c:640 SYSC_sendto+0x361/0x5c0 net/socket.c:1747 SyS_sendto+0x40/0x50 net/socket.c:1715 do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff8801d0d16480 which belongs to the cache kmalloc-1024 of size 1024 The buggy address is located 472 bytes inside of 1024-byte region [ffff8801d0d16480, ffff8801d0d16880) The buggy address belongs to the page: page:ffffea0007434580 count:1 mapcount:0 mapping:ffff8801d0d16000 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000008100(slab|head) raw: 02fffc0000008100 ffff8801d0d16000 0000000000000000 0000000100000007 raw: ffffea0006b2d5a0 ffffea00070c3920 ffff8801dac00ac0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d0d16500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d0d16580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801d0d16600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801d0d16680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d0d16700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================