syzbot


UBSAN: shift-out-of-bounds in parse_audio_format_i

Status: fixed on 2021/03/10 01:48
Subsystems: sound usb
[Documentation on labels]
Reported-by: syzbot+df7dc146ebdd6435eea3@syzkaller.appspotmail.com
Fix commit: 175b8d89fe29 ALSA: pcm: oss: Fix potential out-of-bounds shift 43d5ca88dfcd ALSA: usb-audio: Fix potential out-of-bounds shift
First crash: 1406d, last: 1399d
Cause bisection: failed (error log, bisect log)
  
Discussions (8)
Title Replies (including bot) Last reply
[PATCH 4.14 000/242] 4.14.213-rc1 review 245 (245) 2021/01/13 01:20
[PATCH 4.19 000/346] 4.19.164-rc1 review 356 (356) 2021/01/02 11:29
[PATCH 4.4 000/132] 4.4.249-rc1 review 136 (136) 2020/12/30 09:37
[PATCH 4.9 000/175] 4.9.249-rc1 review 178 (178) 2020/12/29 09:28
[PATCH 5.9 00/49] 5.9.16-rc1 review 56 (56) 2020/12/21 14:31
[PATCH 5.10 00/16] 5.10.2-rc1 review 24 (24) 2020/12/21 13:00
[PATCH 5.4 00/34] 5.4.85-rc1 review 37 (37) 2020/12/20 03:58
UBSAN: shift-out-of-bounds in parse_audio_format_i 0 (1) 2020/12/09 07:33

Sample crash report:
usb 1-1: New USB device found, idVendor=1d6b, idProduct=0101, bcdDevice= 0.40
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: syz
usb 1-1: Manufacturer: syz
usb 1-1: SerialNumber: syz
usb 1-1: 2:1 : no or invalid class specific endpoint descriptor
================================================================================
UBSAN: shift-out-of-bounds in sound/usb/format.c:44:17
shift exponent 4098 is too large for 64-bit type 'long long unsigned int'
CPU: 0 PID: 8656 Comm: kworker/0:4 Not tainted 5.10.0-rc6-next-20201207-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Workqueue: usb_hub_wq hub_event
Call Trace:
 __dump_stack lib/dump_stack.c:79 [inline]
 dump_stack+0x107/0x163 lib/dump_stack.c:120
 ubsan_epilogue+0xb/0x5a lib/ubsan.c:148
 __ubsan_handle_shift_out_of_bounds.cold+0xb1/0x181 lib/ubsan.c:395
 parse_audio_format_i_type sound/usb/format.c:44 [inline]
 parse_audio_format_i.cold+0xba/0x3e2 sound/usb/format.c:653
 snd_usb_parse_audio_format+0x89/0x290 sound/usb/format.c:753
 snd_usb_get_audioformat_uac12 sound/usb/stream.c:841 [inline]
 __snd_usb_parse_audio_interface+0xce4/0x3cf0 sound/usb/stream.c:1170
 snd_usb_parse_audio_interface+0x79/0x130 sound/usb/stream.c:1240
 snd_usb_create_stream.isra.0+0x23a/0x530 sound/usb/card.c:206
 snd_usb_create_streams sound/usb/card.c:278 [inline]
 usb_audio_probe+0x93c/0x2ab0 sound/usb/card.c:802
 usb_probe_interface+0x315/0x7f0 drivers/usb/core/driver.c:396
 really_probe+0x2b1/0xe40 drivers/base/dd.c:554
 driver_probe_device+0x285/0x3f0 drivers/base/dd.c:738
 __device_attach_driver+0x216/0x2d0 drivers/base/dd.c:844
 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:431
 __device_attach+0x228/0x4c0 drivers/base/dd.c:912
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491
 device_add+0xbb2/0x1ce0 drivers/base/core.c:2934
 usb_set_configuration+0x113c/0x1910 drivers/usb/core/message.c:2167
 usb_generic_driver_probe+0xba/0x100 drivers/usb/core/generic.c:238
 usb_probe_device+0xd9/0x2c0 drivers/usb/core/driver.c:293
 really_probe+0x2b1/0xe40 drivers/base/dd.c:554
 driver_probe_device+0x285/0x3f0 drivers/base/dd.c:738
 __device_attach_driver+0x216/0x2d0 drivers/base/dd.c:844
 bus_for_each_drv+0x15f/0x1e0 drivers/base/bus.c:431
 __device_attach+0x228/0x4c0 drivers/base/dd.c:912
 bus_probe_device+0x1e4/0x290 drivers/base/bus.c:491
 device_add+0xbb2/0x1ce0 drivers/base/core.c:2934
 usb_new_device.cold+0x725/0x1057 drivers/usb/core/hub.c:2555
 hub_port_connect drivers/usb/core/hub.c:5223 [inline]
 hub_port_connect_change drivers/usb/core/hub.c:5363 [inline]
 port_event drivers/usb/core/hub.c:5509 [inline]
 hub_event+0x2348/0x42d0 drivers/usb/core/hub.c:5591
 process_one_work+0x98d/0x1630 kernel/workqueue.c:2275
 worker_thread+0x64c/0x1120 kernel/workqueue.c:2421
 kthread+0x3b1/0x4a0 kernel/kthread.c:292
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296
================================================================================

Crashes (19):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/12/08 07:30 linux-next 15ac8fdb7440 51a9082e .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2020/12/15 00:41 linux-next 14240d4c5b25 97183ed7 .config console log report info ci-upstream-linux-next-kasan-gce-root
2020/12/15 00:32 linux-next 14240d4c5b25 97183ed7 .config console log report info ci-upstream-linux-next-kasan-gce-root
2020/12/13 18:58 linux-next 14240d4c5b25 bca53db9 .config console log report info ci-upstream-linux-next-kasan-gce-root
2020/12/12 20:41 linux-next 14240d4c5b25 bca53db9 .config console log report info ci-upstream-linux-next-kasan-gce-root
2020/12/12 20:39 linux-next 14240d4c5b25 bca53db9 .config console log report info ci-upstream-linux-next-kasan-gce-root
2020/12/12 20:39 linux-next 14240d4c5b25 bca53db9 .config console log report info ci-upstream-linux-next-kasan-gce-root
2020/12/12 20:39 linux-next 14240d4c5b25 bca53db9 .config console log report info ci-upstream-linux-next-kasan-gce-root
2020/12/11 07:48 linux-next 14240d4c5b25 f900b48c .config console log report info ci-upstream-linux-next-kasan-gce-root
2020/12/10 23:15 linux-next 14240d4c5b25 f900b48c .config console log report info ci-upstream-linux-next-kasan-gce-root
2020/12/10 21:34 linux-next 14240d4c5b25 f900b48c .config console log report info ci-upstream-linux-next-kasan-gce-root
2020/12/10 21:31 linux-next 14240d4c5b25 f900b48c .config console log report info ci-upstream-linux-next-kasan-gce-root
2020/12/10 21:30 linux-next 14240d4c5b25 f900b48c .config console log report info ci-upstream-linux-next-kasan-gce-root
2020/12/10 21:30 linux-next 14240d4c5b25 f900b48c .config console log report info ci-upstream-linux-next-kasan-gce-root
2020/12/10 18:55 linux-next 14240d4c5b25 f900b48c .config console log report info ci-upstream-linux-next-kasan-gce-root
2020/12/08 21:08 linux-next a9e26cb5f261 a7f7f4a4 .config console log report info ci-upstream-linux-next-kasan-gce-root
2020/12/08 20:41 linux-next a9e26cb5f261 a7f7f4a4 .config console log report info ci-upstream-linux-next-kasan-gce-root
2020/12/08 11:39 linux-next 15ac8fdb7440 51a9082e .config console log report info ci-upstream-linux-next-kasan-gce-root
2020/12/08 07:11 linux-next 15ac8fdb7440 51a9082e .config console log report info ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.