================================================================== BUG: KASAN: use-after-free in __list_add_valid+0xc6/0xd0 lib/list_debug.c:26 Read of size 8 at addr ffff8801ae4b9898 by task syz-executor4/15101 CPU: 1 PID: 15101 Comm: syz-executor4 Not tainted 4.16.0-rc7+ #278 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:0xf7f0ec99 RSP: 002b:00000000f770a09c EFLAGS: 00000286 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000000013 RCX: 0000000020000800 RDX: 0000000000000010 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 12947: 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] snd_seq_create_port+0xfc/0x750 sound/core/seq/seq_ports.c:145 snd_seq_ioctl_create_port+0xed/0x670 sound/core/seq/seq_clientmgr.c:1280 snd_seq_kernel_client_ctl+0x122/0x160 sound/core/seq/seq_clientmgr.c:2360 create_port+0x2c0/0x420 sound/core/seq/seq_dummy.c:149 snd_seq_oss_open+0x20c/0x8b0 sound/core/seq/oss/seq_oss_init.c:221 odev_open+0x6a/0x90 sound/core/seq/oss/seq_oss.c:138 soundcore_open+0x321/0x630 sound/sound_core.c:597 chrdev_open+0x257/0x730 fs/char_dev.c:417 do_dentry_open+0x667/0xd40 fs/open.c:752 vfs_open+0x107/0x220 fs/open.c:866 do_last fs/namei.c:3379 [inline] path_openat+0x1151/0x3530 fs/namei.c:3519 do_filp_open+0x25b/0x3b0 fs/namei.c:3554 do_sys_open+0x502/0x6d0 fs/open.c:1059 C_SYSC_openat fs/open.c:1105 [inline] compat_SyS_openat+0x2d/0x40 fs/open.c:1103 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 12947: 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 port_delete+0x14a/0x190 sound/core/seq/seq_ports.c:278 snd_seq_delete_port+0x39b/0x4b0 sound/core/seq/seq_ports.c:303 snd_seq_ioctl_delete_port+0xb4/0x170 sound/core/seq/seq_clientmgr.c:1325 snd_seq_kernel_client_ctl+0x122/0x160 sound/core/seq/seq_clientmgr.c:2360 snd_seq_event_port_detach+0x101/0x180 sound/core/seq/seq_ports.c:705 delete_port+0x73/0xb0 sound/core/seq/oss/seq_oss_init.c:354 snd_seq_oss_release+0xe4/0x120 sound/core/seq/oss/seq_oss_init.c:433 odev_release+0x52/0x70 sound/core/seq/oss/seq_oss.c:153 __fput+0x327/0x7e0 fs/file_table.c:209 ____fput+0x15/0x20 fs/file_table.c:243 task_work_run+0x199/0x270 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0x9bb/0x1ad0 kernel/exit.c:865 do_group_exit+0x149/0x400 kernel/exit.c:968 get_signal+0x73a/0x16d0 kernel/signal.c:2469 do_signal+0x90/0x1e90 arch/x86/kernel/signal.c:809 exit_to_usermode_loop+0x258/0x2f0 arch/x86/entry/common.c:162 prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline] syscall_return_slowpath arch/x86/entry/common.c:265 [inline] do_syscall_32_irqs_on arch/x86/entry/common.c:336 [inline] do_fast_syscall_32+0xbe6/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 ffff8801ae4b96c0 which belongs to the cache kmalloc-1024 of size 1024 The buggy address is located 472 bytes inside of 1024-byte region [ffff8801ae4b96c0, ffff8801ae4b9ac0) The buggy address belongs to the page: page:ffffea0006b92e00 count:1 mapcount:0 mapping:ffff8801ae4b8040 index:0x0 compound_mapcount: 0 flags: 0x2fffc0000008100(slab|head) raw: 02fffc0000008100 ffff8801ae4b8040 0000000000000000 0000000100000007 raw: ffffea00070efb20 ffffea0007363420 ffff8801dac00ac0 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801ae4b9780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801ae4b9800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8801ae4b9880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801ae4b9900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801ae4b9980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================