bisecting fixing commit since 01364dad1d4577e27a57729d41053f661bb8a5b9 building syzkaller on 78267cec1aaa5e066d66e6a6c76fea1753e51b46 testing commit 01364dad1d4577e27a57729d41053f661bb8a5b9 with gcc (GCC) 8.1.0 kernel signature: a8cead87e61d12e0330466795e61138c49a1ee91ffdec18c3cf0081f3fd4c128 all runs: crashed: KASAN: use-after-free Read in snd_seq_timer_interrupt testing current HEAD c10b57a567e4333b9fdf60b5ec36de9859263ca2 testing commit c10b57a567e4333b9fdf60b5ec36de9859263ca2 with gcc (GCC) 8.1.0 kernel signature: 9c69c162aacc56b8ff3bba7fe23094da396ca23da2d47908a40671b2be0606d3 all runs: crashed: KASAN: use-after-free Read in snd_seq_timer_interrupt revisions tested: 2, total time: 26m32.803829647s (build: 17m24.099078974s, test: 8m15.398672026s) the crash still happens on HEAD commit msg: Linux 4.14.176 crash: KASAN: use-after-free Read in snd_seq_timer_interrupt IPv6: ADDRCONF(NETDEV_UP): batadv_slave_1: link is not ready batman_adv: batadv0: Interface activated: batadv_slave_1 IPv6: ADDRCONF(NETDEV_CHANGE): batadv_slave_1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): veth1_to_batadv: link becomes ready ================================================================== BUG: KASAN: use-after-free in snd_seq_timer_interrupt+0x2eb/0x3b0 sound/core/seq/seq_timer.c:145 Read of size 8 at addr ffff8880a0f52558 by task systemd-udevd/3639 CPU: 0 PID: 3639 Comm: systemd-udevd Not tainted 4.14.176-syzkaller #0 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+0xf7/0x13b lib/dump_stack.c:58 print_address_description.cold.7+0x9/0x1c9 mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.8+0x11a/0x2d3 mm/kasan/report.c:409 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:430 snd_seq_timer_interrupt+0x2eb/0x3b0 sound/core/seq/seq_timer.c:145 snd_timer_interrupt+0x617/0x1080 sound/core/timer.c:869 snd_timer_s_function+0xae/0x130 sound/core/timer.c:1105 call_timer_fn+0x142/0x570 kernel/time/timer.c:1279 expire_timers kernel/time/timer.c:1318 [inline] __run_timers kernel/time/timer.c:1636 [inline] run_timer_softirq+0xc99/0x1210 kernel/time/timer.c:1649 __do_softirq+0x246/0x9b0 kernel/softirq.c:288 invoke_softirq kernel/softirq.c:368 [inline] irq_exit+0x15f/0x1a0 kernel/softirq.c:409 exiting_irq arch/x86/include/asm/apic.h:648 [inline] smp_apic_timer_interrupt+0x149/0x5d0 arch/x86/kernel/apic/apic.c:1102 apic_timer_interrupt+0x96/0xa0 arch/x86/entry/entry_64.S:792 RIP: 0010:arch_local_irq_restore arch/x86/include/asm/paravirt.h:779 [inline] RIP: 0010:kfree+0x117/0x270 mm/slab.c:3816 RSP: 0018:ffff88808dc3f730 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff10 RAX: 0000000000000007 RBX: ffff88809b42b580 RCX: 1ffff11011b86514 RDX: 0000000000000000 RSI: ffff88808dc32880 RDI: 0000000000000282 RBP: ffff88808dc3f750 R08: ffff88808dc328a0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000282 R13: ffff8880aa8001c0 R14: ffffffff82d076e7 R15: 0000000000000000 security_context_to_sid_core+0x277/0x3a0 security/selinux/ss/services.c:1460 security_context_to_sid+0x11/0x20 security/selinux/ss/services.c:1480 selinux_inode_setsecurity+0x162/0x410 security/selinux/hooks.c:3377 selinux_inode_notifysecctx+0x18/0x30 security/selinux/hooks.c:6132 security_inode_notifysecctx+0x6a/0xa0 security/security.c:1314 kernfs_refresh_inode+0x31e/0x4a0 fs/kernfs/inode.c:195 kernfs_iop_permission+0x53/0x80 fs/kernfs/inode.c:302 do_inode_permission fs/namei.c:384 [inline] __inode_permission+0x1b1/0x2a0 fs/namei.c:426 inode_permission+0x1c/0xf0 fs/namei.c:476 may_lookup fs/namei.c:1717 [inline] link_path_walk+0x6ed/0x1540 fs/namei.c:2097 path_openat+0x176/0x3bd0 fs/namei.c:3568 do_filp_open+0x16b/0x220 fs/namei.c:3603 do_sys_open+0x1c2/0x340 fs/open.c:1081 SYSC_open fs/open.c:1099 [inline] SyS_open+0x19/0x20 fs/open.c:1094 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x7f5496df79b1 RSP: 002b:00007ffe908f63f8 EFLAGS: 00000202 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 000055a857b23060 RCX: 00007f5496df79b1 RDX: 00000000000000ff RSI: 0000000000090800 RDI: 000055a857b09f10 RBP: 00007f5497fac710 R08: 000055a857b0ac10 R09: 0000000000001010 R10: 00007f54970ddb58 R11: 0000000000000202 R12: 0000000000000000 R13: 000055a857b09f10 R14: 00000000000000ff R15: 000055a857b09f10 Allocated by task 8039: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:551 kmem_cache_alloc_trace+0x152/0x7a0 mm/slab.c:3618 kmalloc include/linux/slab.h:488 [inline] kzalloc include/linux/slab.h:661 [inline] queue_new sound/core/seq/seq_queue.c:113 [inline] snd_seq_queue_alloc+0x51/0x480 sound/core/seq/seq_queue.c:195 snd_seq_ioctl_create_queue+0xa8/0x2d0 sound/core/seq/seq_clientmgr.c:1528 snd_seq_ioctl+0x1b7/0x380 sound/core/seq/seq_clientmgr.c:2144 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x180/0xfb0 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x74/0x80 fs/ioctl.c:692 do_syscall_64+0x1c7/0x5b0 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 8031: save_stack_trace+0x16/0x20 arch/x86/kernel/stacktrace.c:59 save_stack+0x43/0xd0 mm/kasan/kasan.c:447 set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0x71/0xc0 mm/kasan/kasan.c:524 __cache_free mm/slab.c:3496 [inline] kfree+0xcc/0x270 mm/slab.c:3815 queue_delete+0x8b/0xa0 sound/core/seq/seq_queue.c:156 snd_seq_queue_client_leave+0x27/0x100 sound/core/seq/seq_queue.c:604 seq_free_client1.part.9+0xef/0x260 sound/core/seq/seq_clientmgr.c:263 seq_free_client1 sound/core/seq/seq_clientmgr.c:256 [inline] seq_free_client+0x5c/0xd0 sound/core/seq/seq_clientmgr.c:285 snd_seq_release+0x48/0xe0 sound/core/seq/seq_clientmgr.c:367 __fput+0x232/0x750 fs/file_table.c:210 ____fput+0x9/0x10 fs/file_table.c:244 task_work_run+0xe5/0x170 kernel/task_work.c:113 tracehook_notify_resume include/linux/tracehook.h:191 [inline] exit_to_usermode_loop+0x16a/0x1b0 arch/x86/entry/common.c:164 prepare_exit_to_usermode arch/x86/entry/common.c:199 [inline] syscall_return_slowpath arch/x86/entry/common.c:270 [inline] do_syscall_64+0x416/0x5b0 arch/x86/entry/common.c:297 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff8880a0f52500 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 88 bytes inside of 512-byte region [ffff8880a0f52500, ffff8880a0f52700) The buggy address belongs to the page: page:ffffea000283d480 count:1 mapcount:0 mapping:ffff8880a0f52000 index:0x0 flags: 0xfffe0000000100(slab) raw: 00fffe0000000100 ffff8880a0f52000 0000000000000000 0000000100000006 raw: ffffea0002526e20 ffffea00026de360 ffff8880aa800940 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a0f52400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a0f52480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8880a0f52500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a0f52580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a0f52600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================