syzbot


KASAN: use-after-free Read in snd_mixer_oss_put_volume1

Status: auto-closed as invalid on 2022/05/30 12:47
Reported-by: syzbot+92d0b4aabd0dae12b8c3@syzkaller.appspotmail.com
First crash: 1038d, last: 1038d

Sample crash report:
RDX: 0000000020000000 RSI: 00000000c010f508 RDI: 0000000000000003
RBP: 00007f768676e1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffedf7e709f R14: 00007f768676e300 R15: 0000000000022000
==================================================================
BUG: KASAN: use-after-free in snd_mixer_oss_put_volume1+0xc7c/0xd20 sound/core/oss/mixer_oss.c:734
Read of size 4 at addr ffff8880aee07884 by task syz-executor.0/24472

CPU: 1 PID: 24472 Comm: syz-executor.0 Not tainted 4.19.211-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_put_volume1+0xc7c/0xd20 sound/core/oss/mixer_oss.c:734
 snd_mixer_oss_set_volume sound/core/oss/mixer_oss.c:304 [inline]
 snd_mixer_oss_ioctl1+0x53f/0x18f0 sound/core/oss/mixer_oss.c:367
 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:0x7f7687df9059
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f768676e168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f7687f0bf60 RCX: 00007f7687df9059
RDX: 0000000020000000 RSI: 00000000c010f508 RDI: 0000000000000003
RBP: 00007f768676e1d0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001
R13: 00007ffedf7e709f R14: 00007f768676e300 R15: 0000000000022000

Allocated by task 24439:
 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
 tracehook_notify_resume include/linux/tracehook.h:193 [inline]
 exit_to_usermode_loop+0x251/0x2a0 arch/x86/entry/common.c:167
 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:271 [inline]
 do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 24473:
 __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_proc_write+0x3c8/0x530 sound/core/oss/mixer_oss.c:1206
 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
 tracehook_notify_resume include/linux/tracehook.h:193 [inline]
 exit_to_usermode_loop+0x251/0x2a0 arch/x86/entry/common.c:167
 prepare_exit_to_usermode arch/x86/entry/common.c:198 [inline]
 syscall_return_slowpath arch/x86/entry/common.c:271 [inline]
 do_syscall_64+0x538/0x620 arch/x86/entry/common.c:296
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

The buggy address belongs to the object at ffff8880aee07880
 which belongs to the cache kmalloc-96 of size 96
The buggy address is located 4 bytes inside of
 96-byte region [ffff8880aee07880, ffff8880aee078e0)
The buggy address belongs to the page:
page:ffffea0002bb81c0 count:1 mapcount:0 mapping:ffff88813bff04c0 index:0xffff8880aee07680
flags: 0xfff00000000100(slab)
raw: 00fff00000000100 ffffea00024ea588 ffffea0002a1b1c8 ffff88813bff04c0
raw: ffff8880aee07680 ffff8880aee07000 0000000100000015 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8880aee07780: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
 ffff8880aee07800: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
>ffff8880aee07880: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
                   ^
 ffff8880aee07900: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc
 ffff8880aee07980: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/01/30 12:46 linux-4.19.y 3f8a27f9e27b 495e00c5 .config console log report info ci2-linux-4-19 KASAN: use-after-free Read in snd_mixer_oss_put_volume1
* Struck through repros no longer work on HEAD.