================================================================== BUG: KASAN: use-after-free in snd_timer_check_master sound/core/timer.c:228 [inline] BUG: KASAN: use-after-free in snd_timer_open+0x100a/0x1150 sound/core/timer.c:326 Read of size 8 at addr ffff88809163a078 by task syz-executor.3/30178 CPU: 1 PID: 30178 Comm: syz-executor.3 Not tainted 5.4.0-rc6-next-20191111 #0 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+0x197/0x210 lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xd4/0x30b mm/kasan/report.c:374 __kasan_report.cold+0x1b/0x41 mm/kasan/report.c:506 kasan_report+0x12/0x20 mm/kasan/common.c:634 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 snd_timer_check_master sound/core/timer.c:228 [inline] snd_timer_open+0x100a/0x1150 sound/core/timer.c:326 snd_seq_timer_open+0x27f/0x590 sound/core/seq/seq_timer.c:281 queue_use+0xf1/0x270 sound/core/seq/seq_queue.c:489 snd_seq_queue_alloc+0x2c5/0x4d0 sound/core/seq/seq_queue.c:176 snd_seq_ioctl_create_queue+0xb0/0x330 sound/core/seq/seq_clientmgr.c:1548 snd_seq_kernel_client_ctl+0xf8/0x140 sound/core/seq/seq_clientmgr.c:2353 alloc_seq_queue.isra.0+0xdc/0x180 sound/core/seq/oss/seq_oss_init.c:357 snd_seq_oss_open+0x2ff/0x960 sound/core/seq/oss/seq_oss_init.c:215 odev_open+0x70/0x90 sound/core/seq/oss/seq_oss.c:125 soundcore_open+0x453/0x610 sound/sound_core.c:593 chrdev_open+0x245/0x6b0 fs/char_dev.c:414 do_dentry_open+0x4e6/0x1380 fs/open.c:797 vfs_open+0xa0/0xd0 fs/open.c:914 do_last fs/namei.c:3412 [inline] path_openat+0x10e4/0x4710 fs/namei.c:3529 do_filp_open+0x1a1/0x280 fs/namei.c:3559 do_sys_open+0x3fe/0x5d0 fs/open.c:1097 __do_sys_openat fs/open.c:1124 [inline] __se_sys_openat fs/open.c:1118 [inline] __x64_sys_openat+0x9d/0x100 fs/open.c:1118 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x45a219 Code: ad b6 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 7b b6 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007f97c490ac78 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 000000000045a219 RDX: 0000000000000200 RSI: 0000000020000100 RDI: ffffffffffffff9c RBP: 000000000075bf20 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f97c490b6d4 R13: 00000000004c735b R14: 00000000004dcfa0 R15: 00000000ffffffff Allocated by task 29736: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:510 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:483 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:524 __do_kmalloc mm/slab.c:3656 [inline] __kmalloc+0x163/0x770 mm/slab.c:3665 kmalloc_array include/linux/slab.h:598 [inline] kcalloc include/linux/slab.h:609 [inline] __list_lru_init+0xd1/0x710 mm/list_lru.c:614 alloc_super+0x7f7/0x910 fs/super.c:274 sget_fc+0x14e/0x810 fs/super.c:528 vfs_get_super+0x76/0x2e0 fs/super.c:1184 get_tree_keyed+0x4e/0x60 fs/super.c:1245 mqueue_get_tree+0x5f/0x80 ipc/mqueue.c:427 vfs_get_tree+0x8e/0x300 fs/super.c:1545 fc_mount+0x17/0xc0 fs/namespace.c:962 mq_create_mount+0x1d1/0x280 ipc/mqueue.c:470 mq_init_ns+0x15a/0x210 ipc/mqueue.c:1667 create_ipc_ns ipc/namespace.c:58 [inline] copy_ipcs+0x2ba/0x420 ipc/namespace.c:84 create_new_namespaces+0x21a/0x7b0 kernel/nsproxy.c:83 unshare_nsproxy_namespaces+0xc2/0x200 kernel/nsproxy.c:202 ksys_unshare+0x444/0x980 kernel/fork.c:2919 __do_sys_unshare kernel/fork.c:2987 [inline] __se_sys_unshare kernel/fork.c:2985 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:2985 do_syscall_64+0xfa/0x760 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 29736: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] kasan_set_free_info mm/kasan/common.c:332 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:471 kasan_slab_free+0xe/0x10 mm/kasan/common.c:480 __cache_free mm/slab.c:3426 [inline] kfree+0x10a/0x2c0 mm/slab.c:3757 list_lru_destroy mm/list_lru.c:651 [inline] list_lru_destroy+0x1ce/0x380 mm/list_lru.c:640 deactivate_locked_super+0xaf/0x100 fs/super.c:343 deactivate_super fs/super.c:366 [inline] deactivate_super+0x1b2/0x1d0 fs/super.c:362 cleanup_mnt+0x351/0x4c0 fs/namespace.c:1102 mntput_no_expire+0x7cb/0xbc0 fs/namespace.c:1185 mntput fs/namespace.c:1195 [inline] kern_unmount fs/namespace.c:3809 [inline] kern_unmount+0xbd/0xf0 fs/namespace.c:3803 mq_put_mnt+0x37/0x41 ipc/mqueue.c:1681 put_ipc_ns ipc/namespace.c:151 [inline] put_ipc_ns+0x5c/0x180 ipc/namespace.c:146 free_nsproxy+0xd3/0x230 kernel/nsproxy.c:176 switch_task_namespaces+0xb3/0xd0 kernel/nsproxy.c:225 exit_task_namespaces+0x18/0x20 kernel/nsproxy.c:230 do_exit+0x8ff/0x2e60 kernel/exit.c:816 do_group_exit+0x135/0x360 kernel/exit.c:921 get_signal+0x47c/0x24f0 kernel/signal.c:2734 do_signal+0x87/0x1700 arch/x86/kernel/signal.c:815 exit_to_usermode_loop+0x286/0x380 arch/x86/entry/common.c:159 prepare_exit_to_usermode arch/x86/entry/common.c:194 [inline] syscall_return_slowpath arch/x86/entry/common.c:274 [inline] do_syscall_64+0x65f/0x760 arch/x86/entry/common.c:300 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88809163a000 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 120 bytes inside of 256-byte region [ffff88809163a000, ffff88809163a100) The buggy address belongs to the page: page:ffffea0002458e80 refcount:1 mapcount:0 mapping:ffff8880aa4008c0 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea0002853248 ffffea00018ce148 ffff8880aa4008c0 raw: 0000000000000000 ffff88809163a000 0000000100000008 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888091639f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888091639f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88809163a000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809163a080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809163a100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================