syzbot


KASAN: use-after-free Read in snd_seq_timer_interrupt

Status: upstream: reported C repro on 2020/03/23 11:55
Reported-by: syzbot+0d4211f386d0172c4af4@syzkaller.appspotmail.com
First crash: 1734d, last: 1237d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 KASAN: use-after-free Read in snd_seq_timer_interrupt C error 1 1187d 1277d 0/1 upstream: reported C repro on 2021/06/23 11:22
upstream KASAN: use-after-free Read in snd_seq_timer_interrupt (2) sound C inconclusive 2 1295d 1293d 20/28 fixed on 2021/11/10 00:50
upstream KASAN: use-after-free Read in snd_seq_timer_interrupt sound 1 2250d 2250d 12/28 fixed on 2019/06/14 18:22
Last patch testing requests (4)
Created Duration User Patch Repo Result
2023/02/08 11:32 14m retest repro linux-4.14.y report log
2023/02/08 09:32 14m retest repro linux-4.14.y report log
2022/09/18 04:29 10m retest repro linux-4.14.y report log
2022/09/18 03:29 10m retest repro linux-4.14.y report log
Fix bisection attempts (3)
Created Duration User Patch Repo Result
2020/06/21 14:16 0m bisect fix linux-4.14.y error job log
2020/05/22 12:21 23m bisect fix linux-4.14.y OK (0) job log log
2020/04/22 11:54 26m bisect fix linux-4.14.y OK (0) job log log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in snd_seq_timer_interrupt+0x2d4/0x340 sound/core/seq/seq_timer.c:145
Read of size 8 at addr ffff8880a90c8398 by task syz-executor976/7975

CPU: 0 PID: 7975 Comm: syz-executor976 Not tainted 4.14.241-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __dump_stack lib/dump_stack.c:17 [inline]
 dump_stack+0x1b2/0x281 lib/dump_stack.c:58
 print_address_description.cold+0x54/0x1d3 mm/kasan/report.c:252
 kasan_report_error.cold+0x8a/0x191 mm/kasan/report.c:351
 kasan_report mm/kasan/report.c:409 [inline]
 __asan_report_load8_noabort+0x68/0x70 mm/kasan/report.c:430
 snd_seq_timer_interrupt+0x2d4/0x340 sound/core/seq/seq_timer.c:145
 snd_timer_interrupt.part.0+0x8ea/0xe20 sound/core/timer.c:870
 snd_timer_interrupt sound/core/timer.c:1106 [inline]
 snd_timer_s_function+0x12c/0x1b0 sound/core/timer.c:1106
 call_timer_fn+0x14a/0x650 kernel/time/timer.c:1280
 expire_timers+0x232/0x4d0 kernel/time/timer.c:1319
 __run_timers kernel/time/timer.c:1637 [inline]
 run_timer_softirq+0x1d5/0x5a0 kernel/time/timer.c:1650
 __do_softirq+0x24d/0x9ff kernel/softirq.c:288
 invoke_softirq kernel/softirq.c:368 [inline]
 irq_exit+0x193/0x240 kernel/softirq.c:409
 exiting_irq arch/x86/include/asm/apic.h:638 [inline]
 smp_apic_timer_interrupt+0x141/0x5e0 arch/x86/kernel/apic/apic.c:1106
 apic_timer_interrupt+0x93/0xa0 arch/x86/entry/entry_64.S:793
 </IRQ>
RIP: 0010:__orc_find+0x20/0xf0 arch/x86/kernel/unwind_orc.c:46
RSP: 0018:ffff8880a2b377d8 EFLAGS: 00000297 ORIG_RAX: ffffffffffffff10
RAX: 0000000000000002 RBX: 1ffff11014566f0b RCX: ffffffff87400089
RDX: 0000000000000002 RSI: ffffffff8ae11afc RDI: ffffffff8a6308c0
RBP: 0000000000000001 R08: ffffffff8ae11afc R09: ffffffff8ae11b08
R10: 0000000000146546 R11: 0000000000066071 R12: ffffffff8a6308c4
R13: ffff8880a2b37918 R14: ffff8880a2b37930 R15: ffff8880a2b378e0
 orc_find arch/x86/kernel/unwind_orc.c:118 [inline]
 unwind_next_frame+0x59a/0x17d0 arch/x86/kernel/unwind_orc.c:348
 __save_stack_trace+0x90/0x160 arch/x86/kernel/stacktrace.c:44
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
 slab_post_alloc_hook mm/slab.h:442 [inline]
 slab_alloc mm/slab.c:3390 [inline]
 kmem_cache_alloc+0x111/0x3c0 mm/slab.c:3550
 anon_vma_chain_alloc mm/rmap.c:129 [inline]
 anon_vma_fork+0x1c0/0x580 mm/rmap.c:344
 dup_mmap kernel/fork.c:664 [inline]
 dup_mm kernel/fork.c:1199 [inline]
 copy_mm kernel/fork.c:1254 [inline]
 copy_process.part.0+0x4c64/0x71c0 kernel/fork.c:1790
 copy_process kernel/fork.c:1605 [inline]
 _do_fork+0x184/0xc80 kernel/fork.c:2091
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb
RIP: 0033:0x43eb0b
RSP: 002b:00007ffcc335a8e0 EFLAGS: 00000246 ORIG_RAX: 0000000000000038
RAX: ffffffffffffffda RBX: 00000000000f4240 RCX: 000000000043eb0b
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000001200011
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000628300
R10: 00000000006285d0 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffcc335a90c R14: 00007ffcc335a920 R15: 00007ffcc335a910

Allocated by task 8070:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_kmalloc+0xeb/0x160 mm/kasan/kasan.c:551
 kmem_cache_alloc_trace+0x131/0x3d0 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/0x4c0 sound/core/seq/seq_queue.c:195
 snd_seq_ioctl_create_queue+0xa5/0x2f0 sound/core/seq/seq_clientmgr.c:1528
 snd_seq_ioctl+0x1af/0x310 sound/core/seq/seq_clientmgr.c:2144
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:500 [inline]
 do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684
 SYSC_ioctl fs/ioctl.c:701 [inline]
 SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

Freed by task 8070:
 save_stack mm/kasan/kasan.c:447 [inline]
 set_track mm/kasan/kasan.c:459 [inline]
 kasan_slab_free+0xc3/0x1a0 mm/kasan/kasan.c:524
 __cache_free mm/slab.c:3496 [inline]
 kfree+0xc9/0x250 mm/slab.c:3815
 snd_seq_queue_client_leave+0x2f/0x120 sound/core/seq/seq_queue.c:604
 seq_free_client1.part.0+0xf0/0x270 sound/core/seq/seq_clientmgr.c:263
 seq_free_client1 sound/core/seq/seq_clientmgr.c:256 [inline]
 seq_free_client+0x6c/0xe0 sound/core/seq/seq_clientmgr.c:285
 snd_seq_release+0x4d/0xe0 sound/core/seq/seq_clientmgr.c:367
 __fput+0x25f/0x7a0 fs/file_table.c:210
 task_work_run+0x11f/0x190 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0xa44/0x2850 kernel/exit.c:868
 do_group_exit+0x100/0x2e0 kernel/exit.c:965
 SYSC_exit_group kernel/exit.c:976 [inline]
 SyS_exit_group+0x19/0x20 kernel/exit.c:974
 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292
 entry_SYSCALL_64_after_hwframe+0x46/0xbb

The buggy address belongs to the object at ffff8880a90c8340
 which belongs to the cache kmalloc-512 of size 512
The buggy address is located 88 bytes inside of
 512-byte region [ffff8880a90c8340, ffff8880a90c8540)
The buggy address belongs to the page:
page:ffffea0002a43200 count:1 mapcount:0 mapping:ffff8880a90c80c0 index:0x0
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffff8880a90c80c0 0000000000000000 0000000100000006
raw: ffffea0002afcba0 ffffea0002afcbe0 ffff88813fe80940 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880a90c8280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff8880a90c8300: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
>ffff8880a90c8380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                            ^
 ffff8880a90c8400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8880a90c8480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/08/02 12:06 linux-4.14.y ce4d1565392b 6c236867 .config console log report syz C ci2-linux-4-14 KASAN: use-after-free Read in snd_seq_timer_interrupt
2020/03/23 11:54 linux-4.14.y 01364dad1d45 78267cec .config console log report syz C ci2-linux-4-14
* Struck through repros no longer work on HEAD.