================================================================== BUG: KASAN: use-after-free in snd_seq_queue_alloc+0x47e/0x4a0 sound/core/seq/seq_queue.c:202 at addr ffff8801c7622000 Read of size 4 by task syz-executor1/23085 CPU: 1 PID: 23085 Comm: syz-executor1 Not tainted 4.9.40-g7b2727c #16 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 ffff8801cc49faa8 ffffffff81d8f109 ffff8801da001280 ffff8801c7622000 ffff8801c7622200 ffffed0038ec4400 ffff8801c7622000 ffff8801cc49fad0 ffffffff8153931c ffffed0038ec4400 ffff8801da001280 0000000000000000 Call Trace: [] __dump_stack lib/dump_stack.c:15 [inline] [] dump_stack+0xc1/0x128 lib/dump_stack.c:51 [] kasan_object_err+0x1c/0x70 mm/kasan/report.c:160 [] print_address_description mm/kasan/report.c:198 [inline] [] kasan_report_error mm/kasan/report.c:287 [inline] [] kasan_report.part.1+0x21c/0x500 mm/kasan/report.c:309 [] kasan_report mm/kasan/report.c:329 [inline] [] __asan_report_load4_noabort+0x29/0x30 mm/kasan/report.c:329 [] snd_seq_queue_alloc+0x47e/0x4a0 sound/core/seq/seq_queue.c:202 [] snd_seq_ioctl_create_queue+0xad/0x310 sound/core/seq/seq_clientmgr.c:1508 [] snd_seq_ioctl+0x226/0x4a0 sound/core/seq/seq_clientmgr.c:2131 [] vfs_ioctl fs/ioctl.c:43 [inline] [] do_vfs_ioctl+0x1aa/0x10c0 fs/ioctl.c:679 [] SYSC_ioctl fs/ioctl.c:694 [inline] [] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685 [] entry_SYSCALL_64_fastpath+0x23/0xc6 Object at ffff8801c7622000, in cache kmalloc-512 size: 512 Allocated: PID = 23085 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:495 set_track mm/kasan/kasan.c:507 [inline] kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:598 kmem_cache_alloc_trace+0xfb/0x2a0 mm/slub.c:2742 kmalloc include/linux/slab.h:490 [inline] kzalloc include/linux/slab.h:636 [inline] queue_new sound/core/seq/seq_queue.c:113 [inline] snd_seq_queue_alloc+0x5d/0x4a0 sound/core/seq/seq_queue.c:193 snd_seq_ioctl_create_queue+0xad/0x310 sound/core/seq/seq_clientmgr.c:1508 snd_seq_ioctl+0x226/0x4a0 sound/core/seq/seq_clientmgr.c:2131 vfs_ioctl fs/ioctl.c:43 [inline] do_vfs_ioctl+0x1aa/0x10c0 fs/ioctl.c:679 SYSC_ioctl fs/ioctl.c:694 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685 entry_SYSCALL_64_fastpath+0x23/0xc6 Freed: PID = 23098 save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:57 save_stack+0x43/0xd0 mm/kasan/kasan.c:495 set_track mm/kasan/kasan.c:507 [inline] kasan_slab_free+0x73/0xc0 mm/kasan/kasan.c:571 slab_free_hook mm/slub.c:1355 [inline] slab_free_freelist_hook mm/slub.c:1377 [inline] slab_free mm/slub.c:2958 [inline] kfree+0xf0/0x2f0 mm/slub.c:3878 queue_delete+0x90/0xb0 sound/core/seq/seq_queue.c:156 snd_seq_queue_delete+0x3c/0x50 sound/core/seq/seq_queue.c:215 snd_seq_ioctl_delete_queue+0x6a/0x90 sound/core/seq/seq_clientmgr.c:1534 snd_seq_ioctl+0x226/0x4a0 sound/core/seq/seq_clientmgr.c:2131 vfs_ioctl fs/ioctl.c:43 [inline] do_vfs_ioctl+0x1aa/0x10c0 fs/ioctl.c:679 SYSC_ioctl fs/ioctl.c:694 [inline] SyS_ioctl+0x8f/0xc0 fs/ioctl.c:685 entry_SYSCALL_64_fastpath+0x23/0xc6 Memory state around the buggy address: ffff8801c7621f00: fb fb fb fb fb fb fb fb fc fc fc fc fb fb fb fb ffff8801c7621f80: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801c7622000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801c7622080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801c7622100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================