================================================================== BUG: KASAN: use-after-free in __list_add_valid+0x8f/0xac lib/list_debug.c:26 Read of size 8 at addr ffff8881badcc730 by task syz-executor1/13261 CPU: 1 PID: 13261 Comm: syz-executor1 Not tainted 4.20.0-rc6-next-20181210+ #164 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+0x244/0x39d lib/dump_stack.c:113 print_address_description.cold.4+0x9/0x1ff mm/kasan/report.c:187 kasan_report.cold.5+0x1b/0x39 mm/kasan/report.c:317 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:135 __list_add_valid+0x8f/0xac lib/list_debug.c:26 __list_add include/linux/list.h:60 [inline] list_add_tail include/linux/list.h:93 [inline] neigh_alloc net/core/neighbour.c:395 [inline] ___neigh_create+0x14b7/0x2600 net/core/neighbour.c:553 __neigh_create+0x30/0x40 net/core/neighbour.c:640 ip_finish_output2+0xb91/0x1a30 net/ipv4/ip_output.c:224 ip_finish_output+0x7fd/0xfa0 net/ipv4/ip_output.c:317 NF_HOOK_COND include/linux/netfilter.h:278 [inline] ip_mc_output+0x2c4/0x15b0 net/ipv4/ip_output.c:390 dst_output include/net/dst.h:444 [inline] ip_local_out+0xc5/0x1b0 net/ipv4/ip_output.c:124 ip_send_skb+0x40/0xe0 net/ipv4/ip_output.c:1464 udp_send_skb.isra.46+0x6ad/0x1160 net/ipv4/udp.c:929 udp_sendmsg+0x2953/0x3c40 net/ipv4/udp.c:1216 inet_sendmsg+0x1a1/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:622 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:632 ___sys_sendmsg+0x51d/0x930 net/socket.c:2117 __sys_sendmmsg+0x246/0x6d0 net/socket.c:2212 __do_sys_sendmmsg net/socket.c:2241 [inline] __se_sys_sendmmsg net/socket.c:2238 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2238 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x457679 Code: fd b3 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 cb b3 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f5fcde7bc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000457679 RDX: 040000000000002f RSI: 0000000020007fc0 RDI: 0000000000000008 RBP: 000000000072bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f5fcde7c6d4 R13: 00000000004c3e34 R14: 00000000004d6c58 R15: 00000000ffffffff Allocated by task 6068: save_stack+0x43/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] kasan_kmalloc+0xcb/0xd0 mm/kasan/common.c:482 __do_kmalloc mm/slab.c:3709 [inline] __kmalloc+0x15d/0x760 mm/slab.c:3718 kmalloc_array include/linux/slab.h:668 [inline] kcalloc include/linux/slab.h:679 [inline] alloc_pipe_info+0x2ce/0x5d0 fs/pipe.c:650 get_pipe_inode fs/pipe.c:712 [inline] create_pipe_files+0x91/0x720 fs/pipe.c:744 __do_pipe_flags+0x45/0x250 fs/pipe.c:781 do_pipe2+0x9d/0x310 fs/pipe.c:829 __do_sys_pipe2 fs/pipe.c:847 [inline] __se_sys_pipe2 fs/pipe.c:845 [inline] __x64_sys_pipe2+0x54/0x80 fs/pipe.c:845 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 6068: save_stack+0x43/0xd0 mm/kasan/common.c:73 set_track mm/kasan/common.c:85 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:444 kasan_slab_free+0xe/0x10 mm/kasan/common.c:452 __cache_free mm/slab.c:3485 [inline] kfree+0xcf/0x230 mm/slab.c:3804 free_pipe_info+0x24b/0x300 fs/pipe.c:683 put_pipe_info+0xd0/0xf0 fs/pipe.c:556 pipe_release+0x1de/0x270 fs/pipe.c:577 __fput+0x3bc/0xa90 fs/file_table.c:279 ____fput+0x15/0x20 fs/file_table.c:312 task_work_run+0x1e8/0x2a0 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_usermode_loop+0x318/0x380 arch/x86/entry/common.c:166 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x6be/0x820 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8881badcc4c0 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 624 bytes inside of 1024-byte region [ffff8881badcc4c0, ffff8881badcc8c0) The buggy address belongs to the page: page:ffffea0006eb7300 count:1 mapcount:0 mapping:ffff8881da800ac0 index:0xffff8881badcdb40 compound_mapcount: 0 flags: 0x2fffc0000010200(slab|head) raw: 02fffc0000010200 ffffea0007635b08 ffffea000712e888 ffff8881da800ac0 raw: ffff8881badcdb40 ffff8881badcc040 0000000100000002 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881badcc600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881badcc680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881badcc700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881badcc780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881badcc800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================