syzbot


WARNING in snd_usbmidi_output_open

Status: fixed on 2023/02/24 13:50
Subsystems: alsa usb
[Documentation on labels]
Reported-by: syzbot+9abda841d636d86c41da@syzkaller.appspotmail.com
Fix commit: ad72c3c3f6eb ALSA: usb-audio: Drop snd_BUG_ON() from snd_usbmidi_output_open()
First crash: 556d, last: 548d
Cause bisection: introduced by (bisect log) :
commit 4f8ed19593872b710f27bbc3b7a9ce03310efc57
Author: Mark Brown <broonie@kernel.org>
Date: Thu Jun 2 13:10:58 2022 +0000

  ASoC: tfa9879: Use modern ASoC DAI format terminology

Crash: KASAN: use-after-free Read in driver_register (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] WARNING in snd_usbmidi_output_open 2 (4) 2022/11/12 14:10

Sample crash report:
------------[ cut here ]------------
BUG?
WARNING: CPU: 0 PID: 5267 at sound/usb/midi.c:1137 snd_usbmidi_output_open+0xd8/0x410 sound/usb/midi.c:1137
Modules linked in:
CPU: 0 PID: 5267 Comm: syz-executor895 Not tainted 6.1.0-rc4-next-20221111-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022
RIP: 0010:snd_usbmidi_output_open+0xd8/0x410 sound/usb/midi.c:1137
Code: 3c 02 00 0f 85 03 03 00 00 4d 8b be 10 02 00 00 4d 85 ff 0f 85 c8 00 00 00 e8 d4 92 25 fa 48 c7 c7 a0 6e f2 8a e8 02 da 04 02 <0f> 0b 41 bc fa ff ff ff e8 bb 92 25 fa 44 89 e0 48 83 c4 08 5b 5d
RSP: 0018:ffffc90003b7f3a0 EFLAGS: 00010282
RAX: 0000000000000000 RBX: ffff888146c8d000 RCX: 0000000000000000
RDX: ffff8880245d3a80 RSI: ffffffff81624e68 RDI: fffff5200076fe66
RBP: ffff88801ed9c900 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000080000000 R11: 0000000000000000 R12: ffff88814017cc00
R13: 0000000000000000 R14: ffff88802b1d5000 R15: 0000000000000000
FS:  00005555574d4300(0000) GS:ffff8880b9a00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f6ed57c3670 CR3: 0000000076149000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 open_substream+0x41d/0x8c0 sound/core/rawmidi.c:344
 rawmidi_open_priv+0x591/0x6f0 sound/core/rawmidi.c:394
 snd_rawmidi_kernel_open+0x1b5/0x270 sound/core/rawmidi.c:429
 midisynth_use+0xee/0x270 sound/core/seq/seq_midi.c:215
 subscribe_port sound/core/seq/seq_ports.c:412 [inline]
 check_and_subscribe_port+0x89a/0xb80 sound/core/seq/seq_ports.c:495
 snd_seq_port_connect+0x382/0x540 sound/core/seq/seq_ports.c:581
 snd_seq_ioctl_subscribe_port+0x1fc/0x400 sound/core/seq/seq_clientmgr.c:1490
 snd_seq_kernel_client_ctl+0x102/0x1c0 sound/core/seq/seq_clientmgr.c:2367
 snd_seq_oss_midi_open+0x582/0x6e0 sound/core/seq/oss/seq_oss_midi.c:361
 snd_seq_oss_synth_setup_midi+0x12d/0x530 sound/core/seq/oss/seq_oss_synth.c:269
 snd_seq_oss_open+0x8b8/0xa70 sound/core/seq/oss/seq_oss_init.c:260
 odev_open+0x6c/0x90 sound/core/seq/oss/seq_oss.c:128
 soundcore_open+0x44e/0x620 sound/sound_core.c:593
 chrdev_open+0x266/0x770 fs/char_dev.c:414
 do_dentry_open+0x6cc/0x13f0 fs/open.c:882
 do_open fs/namei.c:3557 [inline]
 path_openat+0x1bbc/0x2a50 fs/namei.c:3713
 do_filp_open+0x1b6/0x400 fs/namei.c:3740
 do_sys_openat2+0x16d/0x4c0 fs/open.c:1310
 do_sys_open fs/open.c:1326 [inline]
 __do_sys_openat fs/open.c:1342 [inline]
 __se_sys_openat fs/open.c:1337 [inline]
 __x64_sys_openat+0x13f/0x1f0 fs/open.c:1337
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7f496367ae39
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:00007ffc99e01aa8 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00000000000f4240 RCX: 00007f496367ae39
RDX: 0000000000020983 RSI: 0000000020000080 RDI: ffffffffffffff9c
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000246 R12: 000000000000d066
R13: 00007ffc99e01abc R14: 00007ffc99e01ad0 R15: 00007ffc99e01ac0
 </TASK>

Crashes (37):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/11/11 15:44 linux-next f8f60f322f06 3ead01ad .config strace log report syz C ci-upstream-linux-next-kasan-gce-root WARNING in snd_usbmidi_output_open
2022/11/19 01:51 upstream 84368d882b96 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING in snd_usbmidi_output_open
2022/11/18 23:05 upstream 84368d882b96 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING in snd_usbmidi_output_open
2022/11/18 21:05 upstream 84368d882b96 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING in snd_usbmidi_output_open
2022/11/18 20:38 upstream 84368d882b96 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root WARNING in snd_usbmidi_output_open
2022/11/18 20:08 upstream 84368d882b96 5bb70014 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root WARNING in snd_usbmidi_output_open
2022/11/17 16:13 upstream cc675d22e422 3a127a31 .config console log report info ci-upstream-kasan-gce-root WARNING in snd_usbmidi_output_open
2022/11/17 15:35 upstream cc675d22e422 3a127a31 .config console log report info ci-upstream-kasan-gce-smack-root WARNING in snd_usbmidi_output_open
2022/11/17 13:53 upstream cc675d22e422 3a127a31 .config console log report info ci-upstream-kasan-gce-root WARNING in snd_usbmidi_output_open
2022/11/17 05:32 upstream 59d0d52c30d4 3a127a31 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING in snd_usbmidi_output_open
2022/11/17 04:49 upstream 59d0d52c30d4 3a127a31 .config console log report info ci-upstream-kasan-gce-selinux-root WARNING in snd_usbmidi_output_open
2022/11/16 17:10 upstream 59d0d52c30d4 3a127a31 .config console log report info ci-upstream-kasan-gce-smack-root WARNING in snd_usbmidi_output_open
2022/11/16 09:36 upstream 81e7cfa3a9eb 3a127a31 .config console log report info ci-upstream-kasan-gce WARNING in snd_usbmidi_output_open
2022/11/15 15:51 upstream e01d50cbd6ee 97de9cfc .config console log report info ci-upstream-kasan-gce-smack-root WARNING in snd_usbmidi_output_open
2022/11/14 20:23 upstream 094226ad94f4 943f4cb8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING in snd_usbmidi_output_open
2022/11/14 20:19 upstream 094226ad94f4 943f4cb8 .config console log report info ci-upstream-kasan-gce-root WARNING in snd_usbmidi_output_open
2022/11/14 19:47 upstream 094226ad94f4 943f4cb8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING in snd_usbmidi_output_open
2022/11/14 19:22 upstream 094226ad94f4 943f4cb8 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce WARNING in snd_usbmidi_output_open
2022/11/14 06:40 upstream af7a05689189 3ead01ad .config console log report info ci-upstream-kasan-gce WARNING in snd_usbmidi_output_open
2022/11/13 21:21 upstream af7a05689189 3ead01ad .config console log report info ci-upstream-kasan-gce-smack-root WARNING in snd_usbmidi_output_open
2022/11/13 11:26 upstream fef7fd48922d 3ead01ad .config console log report info ci-upstream-kasan-gce-selinux-root WARNING in snd_usbmidi_output_open
2022/11/13 05:45 upstream fef7fd48922d 3ead01ad .config console log report info ci-upstream-kasan-gce WARNING in snd_usbmidi_output_open
2022/11/13 05:14 upstream fef7fd48922d 3ead01ad .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root WARNING in snd_usbmidi_output_open
2022/11/13 02:56 upstream 8f2975c2bb4c 3ead01ad .config console log report info ci-upstream-kasan-gce WARNING in snd_usbmidi_output_open
2022/11/13 00:53 upstream 8f2975c2bb4c 3ead01ad .config console log report info ci-upstream-kasan-gce WARNING in snd_usbmidi_output_open
2022/11/12 23:47 upstream 8f2975c2bb4c 3ead01ad .config console log report info ci-upstream-kasan-gce WARNING in snd_usbmidi_output_open
2022/11/12 22:47 upstream 8f2975c2bb4c 3ead01ad .config console log report info ci-upstream-kasan-gce-smack-root WARNING in snd_usbmidi_output_open
2022/11/12 20:38 upstream 8f2975c2bb4c 3ead01ad .config console log report info ci-upstream-kasan-gce WARNING in snd_usbmidi_output_open
2022/11/12 19:16 upstream 8f2975c2bb4c 3ead01ad .config console log report info ci-upstream-kasan-gce WARNING in snd_usbmidi_output_open
2022/11/12 17:06 upstream 8f2975c2bb4c 3ead01ad .config console log report info ci-upstream-kasan-gce WARNING in snd_usbmidi_output_open
2022/11/11 23:34 upstream f5020a08b2b3 3ead01ad .config console log report info ci-upstream-kasan-gce WARNING in snd_usbmidi_output_open
2022/11/11 22:44 upstream f9bbe0c99e5b 3ead01ad .config console log report info ci-upstream-kasan-gce-root WARNING in snd_usbmidi_output_open
2022/11/18 03:26 upstream 84368d882b96 5bb70014 .config console log report info ci-qemu-upstream-386 WARNING in snd_usbmidi_output_open
2022/11/17 18:48 upstream 81ac25651a62 4ba8ab94 .config console log report info ci-qemu-upstream-386 WARNING in snd_usbmidi_output_open
2022/11/14 19:45 upstream 094226ad94f4 943f4cb8 .config console log report info ci-qemu-upstream-386 WARNING in snd_usbmidi_output_open
2022/11/13 12:17 linux-next f8f60f322f06 3ead01ad .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING in snd_usbmidi_output_open
2022/11/11 10:17 linux-next f8f60f322f06 3ead01ad .config console log report info ci-upstream-linux-next-kasan-gce-root WARNING in snd_usbmidi_output_open
* Struck through repros no longer work on HEAD.