syzbot


KASAN: use-after-free Read in snd_mixer_oss_get_volume1

Status: upstream: reported C repro on 2021/09/08 00:32
Reported-by: syzbot+248bd82ed0e0bcc729d3@syzkaller.appspotmail.com
First crash: 1153d, last: 1123d
Fix bisection: failed (error log, bisect log)
  
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in snd_mixer_oss_get_volume1 sound C inconclusive 1 1114d 1110d 20/28 fixed on 2022/03/08 16:11
Fix bisection attempts (2)
Created Duration User Patch Repo Result
2021/11/07 02:12 11m bisect fix linux-4.19.y error job log
2021/10/08 01:45 26m bisect fix linux-4.19.y OK (0) job log log

Sample crash report:
==================================================================
BUG: KASAN: use-after-free in snd_mixer_oss_get_volume1+0x574/0x610 sound/core/oss/mixer_oss.c:612
Read of size 4 at addr ffff888098918084 by task syz-executor087/8128

CPU: 1 PID: 8128 Comm: syz-executor087 Not tainted 4.19.206-syzkaller #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+0x1fc/0x2ef lib/dump_stack.c:118
 print_address_description.cold+0x54/0x219 mm/kasan/report.c:256
 kasan_report_error.cold+0x8a/0x1b9 mm/kasan/report.c:354
 kasan_report mm/kasan/report.c:412 [inline]
 __asan_report_load4_noabort+0x88/0x90 mm/kasan/report.c:432
 snd_mixer_oss_get_volume1+0x574/0x610 sound/core/oss/mixer_oss.c:612
 snd_mixer_oss_get_volume sound/core/oss/mixer_oss.c:272 [inline]
 snd_mixer_oss_ioctl1+0x236/0x18f0 sound/core/oss/mixer_oss.c:372
 snd_mixer_oss_ioctl+0x40/0x50 sound/core/oss/mixer_oss.c:382
 vfs_ioctl fs/ioctl.c:46 [inline]
 file_ioctl fs/ioctl.c:501 [inline]
 do_vfs_ioctl+0xcdb/0x12e0 fs/ioctl.c:688
 ksys_ioctl+0x9b/0xc0 fs/ioctl.c:705
 __do_sys_ioctl fs/ioctl.c:712 [inline]
 __se_sys_ioctl fs/ioctl.c:710 [inline]
 __x64_sys_ioctl+0x6f/0xb0 fs/ioctl.c:710
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x440339
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 14 00 00 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 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffdb4003348 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000000f4240 RCX: 0000000000440339
RDX: 0000000000000000 RSI: 0000000080254d18 RDI: 0000000000000003
RBP: 00000000004830b6 R08: 0000000000000001 R09: 0000000000000001
R10: 00007ffdb4002dc0 R11: 0000000000000246 R12: 0000000000008a17
R13: 00007ffdb400335c R14: 00007ffdb4003370 R15: 00007ffdb4003360

Allocated by task 8127:
 kmem_cache_alloc_trace+0x12f/0x380 mm/slab.c:3625
 kmalloc include/linux/slab.h:515 [inline]
 snd_mixer_oss_build_input+0x640/0xd80 sound/core/oss/mixer_oss.c:1092
 snd_mixer_oss_proc_write+0x37e/0x530 sound/core/oss/mixer_oss.c:1232
 snd_info_text_entry_release+0xfa/0x260 sound/core/info.c:425
 close_pdeo.part.0+0xda/0x2f0 fs/proc/inode.c:176
 close_pdeo fs/proc/inode.c:401 [inline]
 proc_reg_release+0x21e/0x270 fs/proc/inode.c:395
 __fput+0x2ce/0x890 fs/file_table.c:278
 task_work_run+0x148/0x1c0 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0xbf3/0x2be0 kernel/exit.c:870
 do_group_exit+0x125/0x310 kernel/exit.c:967
 __do_sys_exit_group kernel/exit.c:978 [inline]
 __se_sys_exit_group kernel/exit.c:976 [inline]
 __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:976
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 8125:
 __cache_free mm/slab.c:3503 [inline]
 kfree+0xcc/0x210 mm/slab.c:3822
 snd_mixer_oss_slot_free+0xf3/0x130 sound/core/oss/mixer_oss.c:955
 mixer_slot_clear+0x5a/0xb0 sound/core/oss/mixer_oss.c:963
 snd_mixer_oss_build_input+0x7d3/0xd80 sound/core/oss/mixer_oss.c:1100
 snd_mixer_oss_proc_write+0x37e/0x530 sound/core/oss/mixer_oss.c:1232
 snd_info_text_entry_release+0xfa/0x260 sound/core/info.c:425
 close_pdeo.part.0+0xda/0x2f0 fs/proc/inode.c:176
 close_pdeo fs/proc/inode.c:401 [inline]
 proc_reg_release+0x21e/0x270 fs/proc/inode.c:395
 __fput+0x2ce/0x890 fs/file_table.c:278
 task_work_run+0x148/0x1c0 kernel/task_work.c:113
 exit_task_work include/linux/task_work.h:22 [inline]
 do_exit+0xbf3/0x2be0 kernel/exit.c:870
 do_group_exit+0x125/0x310 kernel/exit.c:967
 __do_sys_exit_group kernel/exit.c:978 [inline]
 __se_sys_exit_group kernel/exit.c:976 [inline]
 __x64_sys_exit_group+0x3a/0x50 kernel/exit.c:976
 do_syscall_64+0xf9/0x620 arch/x86/entry/common.c:293
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff888098918080
 which belongs to the cache kmalloc-96 of size 96
The buggy address is located 4 bytes inside of
 96-byte region [ffff888098918080, ffff8880989180e0)
The buggy address belongs to the page:
page:ffffea0002624600 count:1 mapcount:0 mapping:ffff88813bff04c0 index:0x0
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffffea0002bee108 ffffea0002aea848 ffff88813bff04c0
raw: 0000000000000000 ffff888098918000 0000000100000020 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888098917f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
 ffff888098918000: 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc
>ffff888098918080: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
                   ^
 ffff888098918100: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
 ffff888098918180: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
==================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/09/08 01:45 linux-4.19.y b172b44fcb17 064c9eb7 .config console log report syz C ci2-linux-4-19 KASAN: use-after-free Read in snd_mixer_oss_get_volume1
2021/09/08 00:31 linux-4.19.y b172b44fcb17 064c9eb7 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in snd_mixer_oss_get_volume1
* Struck through repros no longer work on HEAD.