================================================================== BUG: KASAN: use-after-free in __list_add_valid+0xc6/0xd0 lib/list_debug.c:26 Read of size 8 at addr ffff88019d378698 by task syz-executor7/23156 CPU: 1 PID: 23156 Comm: syz-executor7 Not tainted 4.16.0-rc6+ #276 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:1649 __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_32_irqs_on arch/x86/entry/common.c:330 [inline] do_fast_syscall_32+0x3ec/0xf9f arch/x86/entry/common.c:392 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 RIP: 0023:0xf7f9fc99 RSP: 002b:00000000f779b09c EFLAGS: 00000286 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000000013 RCX: 0000000020004f00 RDX: 0000000000000047 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 16947: 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:3669 [inline] __kmalloc_node+0x47/0x70 mm/slab.c:3676 kmalloc_node include/linux/slab.h:554 [inline] kvmalloc_node+0x99/0xd0 mm/util.c:419 kvmalloc include/linux/mm.h:541 [inline] xt_alloc_table_info+0x25/0x80 net/netfilter/x_tables.c:1040 compat_do_replace.isra.14+0x17f/0x720 net/ipv6/netfilter/ip6_tables.c:1526 compat_do_ip6t_set_ctl+0x106/0x150 net/ipv6/netfilter/ip6_tables.c:1566 compat_nf_sockopt net/netfilter/nf_sockopt.c:144 [inline] compat_nf_setsockopt+0x88/0x130 net/netfilter/nf_sockopt.c:156 compat_ipv6_setsockopt+0x12b/0x1c0 net/ipv6/ipv6_sockglue.c:958 inet_csk_compat_setsockopt+0x95/0x120 net/ipv4/inet_connection_sock.c:1041 compat_tcp_setsockopt+0x3d/0x70 net/ipv4/tcp.c:2916 compat_sock_common_setsockopt+0xb2/0x140 net/core/sock.c:2986 C_SYSC_setsockopt net/compat.c:403 [inline] compat_SyS_setsockopt net/compat.c:386 [inline] C_SYSC_socketcall net/compat.c:853 [inline] compat_SyS_socketcall+0xbf7/0x17c0 net/compat.c:788 do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline] do_fast_syscall_32+0x3ec/0xf9f arch/x86/entry/common.c:392 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 Freed by task 16947: 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 kvfree+0x36/0x60 mm/util.c:438 xt_free_table_info+0x110/0x170 net/netfilter/x_tables.c:1060 translate_compat_table+0x1755/0x1c50 net/ipv6/netfilter/ip6_tables.c:1489 compat_do_replace.isra.14+0x30e/0x720 net/ipv6/netfilter/ip6_tables.c:1537 compat_do_ip6t_set_ctl+0x106/0x150 net/ipv6/netfilter/ip6_tables.c:1566 compat_nf_sockopt net/netfilter/nf_sockopt.c:144 [inline] compat_nf_setsockopt+0x88/0x130 net/netfilter/nf_sockopt.c:156 compat_ipv6_setsockopt+0x12b/0x1c0 net/ipv6/ipv6_sockglue.c:958 inet_csk_compat_setsockopt+0x95/0x120 net/ipv4/inet_connection_sock.c:1041 compat_tcp_setsockopt+0x3d/0x70 net/ipv4/tcp.c:2916 compat_sock_common_setsockopt+0xb2/0x140 net/core/sock.c:2986 C_SYSC_setsockopt net/compat.c:403 [inline] compat_SyS_setsockopt net/compat.c:386 [inline] C_SYSC_socketcall net/compat.c:853 [inline] compat_SyS_socketcall+0xbf7/0x17c0 net/compat.c:788 do_syscall_32_irqs_on arch/x86/entry/common.c:330 [inline] do_fast_syscall_32+0x3ec/0xf9f arch/x86/entry/common.c:392 entry_SYSENTER_compat+0x70/0x7f arch/x86/entry/entry_64_compat.S:139 The buggy address belongs to the object at ffff88019d3784c0 which belongs to the cache kmalloc-1024 of size 1024 The buggy address is located 472 bytes inside of 1024-byte region [ffff88019d3784c0, ffff88019d3788c0) The buggy address belongs to the page: page:ffffea000674de00 count:1 mapcount:0 mapping:ffff88019d378040 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000008100(slab|head) raw: 02fffc0000008100 ffff88019d378040 0000000000000000 0000000100000007 raw: ffffea000632dd20 ffffea0006328fa0 ffff8801dac00ac0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88019d378580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88019d378600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88019d378680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88019d378700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88019d378780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================