================================================================== BUG: KASAN: use-after-free in __list_del_entry_valid+0xd2/0xf5 lib/list_debug.c:42 Read of size 8 at addr ffff88809b220360 by task blkid/22310 CPU: 1 PID: 22310 Comm: blkid Not tainted 5.1.0-rc4-next-20190409 #21 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+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0x7c/0x20d mm/kasan/report.c:187 kasan_report.cold+0x1b/0x40 mm/kasan/report.c:317 __asan_report_load8_noabort+0x14/0x20 mm/kasan/generic_report.c:132 __list_del_entry_valid+0xd2/0xf5 lib/list_debug.c:42 __list_del_entry include/linux/list.h:117 [inline] list_del_init include/linux/list.h:176 [inline] snd_timer_process_callbacks+0x7f/0x2f0 sound/core/timer.c:763 snd_timer_interrupt sound/core/timer.c:883 [inline] snd_timer_interrupt+0x578/0xdd0 sound/core/timer.c:804 snd_hrtimer_callback+0x219/0x3e0 sound/core/hrtimer.c:64 __run_hrtimer kernel/time/hrtimer.c:1389 [inline] __hrtimer_run_queues+0x33e/0xde0 kernel/time/hrtimer.c:1451 hrtimer_interrupt+0x314/0x770 kernel/time/hrtimer.c:1509 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1035 [inline] smp_apic_timer_interrupt+0x120/0x570 arch/x86/kernel/apic/apic.c:1060 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:807 RIP: 0010:rb_next+0x73/0x140 lib/rbtree.c:539 Code: 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 cf 00 00 00 49 be 00 00 00 00 00 fc ff df 49 8b 44 24 08 48 bb 00 00 00 00 00 fc ff df <48> 85 c0 75 54 4c 89 eb 48 83 e3 fc 48 89 d8 74 38 48 8d 7b 08 48 RSP: 0018:ffff888085fdfa88 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000000 RBX: dffffc0000000000 RCX: ffffffff819bfb0a RDX: 1ffff110133c52cb RSI: ffffffff819bfaaf RDI: ffff888099e29658 RBP: ffff888085fdfab0 R08: ffff8880842e2640 R09: ffffffff895f9394 R10: ffff8880842e2f10 R11: ffff8880842e2640 R12: ffff888099e29650 R13: ffff88808e789e91 R14: dffffc0000000000 R15: 0000000000400000 validate_mm_rb+0x37/0xc0 mm/mmap.c:377 vma_rb_insert mm/mmap.c:451 [inline] __vma_link_rb+0x263/0x370 mm/mmap.c:607 __vma_link mm/mmap.c:635 [inline] __insert_vm_struct mm/mmap.c:671 [inline] __vma_adjust+0xeeb/0x1840 mm/mmap.c:902 vma_adjust include/linux/mm.h:2303 [inline] __split_vma+0x2c9/0x570 mm/mmap.c:2691 split_vma+0xa6/0xf0 mm/mmap.c:2720 mprotect_fixup+0x826/0xa70 mm/mprotect.c:418 do_mprotect_pkey+0x594/0xa30 mm/mprotect.c:556 __do_sys_mprotect mm/mprotect.c:581 [inline] __se_sys_mprotect mm/mprotect.c:578 [inline] __x64_sys_mprotect+0x78/0xb0 mm/mprotect.c:578 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fcb7bb0c447 Code: 73 01 c3 48 8d 0d 5d ad 20 00 31 d2 48 29 c2 89 11 48 83 c8 ff eb eb 90 90 90 90 90 90 90 90 90 90 90 90 b8 0a 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8d 0d 2d ad 20 00 31 d2 48 29 c2 89 RSP: 002b:00007ffd92ecdc58 EFLAGS: 00000206 ORIG_RAX: 000000000000000a RAX: ffffffffffffffda RBX: 00007fcb7bd0e000 RCX: 00007fcb7bb0c447 RDX: 0000000000000001 RSI: 0000000000001000 RDI: 00007fcb7b540000 RBP: 00007ffd92ecdd50 R08: 0000000000000001 R09: 0000000000000010 R10: 00007fcb7b33e5d0 R11: 0000000000000206 R12: 00007fcb7b33d000 R13: 00007fcb7b541180 R14: 00007fcb7b33e5d0 R15: 00007fcb7b540fe0 Allocated by task 21880: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_kmalloc mm/kasan/common.c:497 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:470 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:511 kmem_cache_alloc_trace+0x151/0x760 mm/slab.c:3621 kmalloc include/linux/slab.h:547 [inline] kzalloc include/linux/slab.h:742 [inline] snd_timer_instance_new+0x4f/0x3d0 sound/core/timer.c:109 snd_timer_open+0x8a7/0x1760 sound/core/timer.c:313 snd_seq_timer_open+0x240/0x590 sound/core/seq/seq_timer.c:290 queue_use+0xcb/0x240 sound/core/seq/seq_queue.c:502 snd_seq_queue_alloc+0x2c5/0x4d0 sound/core/seq/seq_queue.c:189 snd_seq_ioctl_create_queue+0xb0/0x330 sound/core/seq/seq_clientmgr.c:1522 snd_seq_ioctl+0x224/0x3e0 sound/core/seq/seq_clientmgr.c:2138 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:509 [inline] do_vfs_ioctl+0xd6e/0x1390 fs/ioctl.c:696 ksys_ioctl+0xab/0xd0 fs/ioctl.c:713 __do_sys_ioctl fs/ioctl.c:720 [inline] __se_sys_ioctl fs/ioctl.c:718 [inline] __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:718 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 21880: save_stack+0x45/0xd0 mm/kasan/common.c:75 set_track mm/kasan/common.c:87 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:459 kasan_slab_free+0xe/0x10 mm/kasan/common.c:467 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3821 snd_timer_close_locked+0x6fd/0xd60 sound/core/timer.c:405 snd_timer_close+0x2e/0x70 sound/core/timer.c:430 snd_seq_timer_close+0x91/0xd0 sound/core/seq/seq_timer.c:329 queue_delete+0x52/0xb0 sound/core/seq/seq_queue.c:147 snd_seq_queue_client_leave+0x36/0x170 sound/core/seq/seq_queue.c:584 seq_free_client1.part.0+0xf3/0x270 sound/core/seq/seq_clientmgr.c:263 seq_free_client1 sound/core/seq/seq_clientmgr.c:256 [inline] seq_free_client+0x80/0xf0 sound/core/seq/seq_clientmgr.c:285 snd_seq_release+0x55/0xf0 sound/core/seq/seq_clientmgr.c:366 __fput+0x2e5/0x8d0 fs/file_table.c:278 ____fput+0x16/0x20 fs/file_table.c:309 task_work_run+0x14a/0x1c0 kernel/task_work.c:113 get_signal+0x1961/0x1d50 kernel/signal.c:2391 do_signal+0x87/0x1940 arch/x86/kernel/signal.c:816 exit_to_usermode_loop+0x244/0x2c0 arch/x86/entry/common.c:162 prepare_exit_to_usermode arch/x86/entry/common.c:197 [inline] syscall_return_slowpath arch/x86/entry/common.c:268 [inline] do_syscall_64+0x52d/0x610 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff88809b2202c0 which belongs to the cache kmalloc-256 of size 256 The buggy address is located 160 bytes inside of 256-byte region [ffff88809b2202c0, ffff88809b2203c0) The buggy address belongs to the page: page:ffffea00026c8800 count:1 mapcount:0 mapping:ffff88812c3f07c0 index:0x0 flags: 0x1fffc0000000200(slab) raw: 01fffc0000000200 ffffea000255a3c8 ffffea0002a26548 ffff88812c3f07c0 raw: 0000000000000000 ffff88809b220040 000000010000000c 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809b220200: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ffff88809b220280: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb >ffff88809b220300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809b220380: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88809b220400: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================