[v5.15] UBSAN: shift-out-of-bounds in parse_audio_unit

0 views
Skip to first unread message

syzbot

unread,
Sep 22, 2024, 2:15:20 PMSep 22
to syzkaller...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 3a5928702e71 Linux 5.15.167
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=12324107980000
kernel config: https://syzkaller.appspot.com/x/.config?x=4d3fd5cca89ae935
dashboard link: https://syzkaller.appspot.com/bug?extid=dbad4fcfae2c7bfc2af8
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ef5025f3d708/disk-3a592870.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/776fbdad3aa8/vmlinux-3a592870.xz
kernel image: https://storage.googleapis.com/syzbot-assets/79541db5bd16/bzImage-3a592870.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+dbad4f...@syzkaller.appspotmail.com

usb 3-1: 0:2 : does not exist
================================================================================
UBSAN: shift-out-of-bounds in sound/usb/mixer.c:2035:20
shift exponent 41 is too large for 32-bit type 'int'
CPU: 0 PID: 3612 Comm: kworker/0:6 Not tainted 5.15.167-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024
Workqueue: usb_hub_wq hub_event
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106
ubsan_epilogue lib/ubsan.c:151 [inline]
__ubsan_handle_shift_out_of_bounds+0x3bf/0x420 lib/ubsan.c:321
parse_audio_feature_unit sound/usb/mixer.c:2035 [inline]
parse_audio_unit+0x265a/0x3df0 sound/usb/mixer.c:2885
snd_usb_mixer_controls sound/usb/mixer.c:3230 [inline]
snd_usb_create_mixer+0x1235/0x2e70 sound/usb/mixer.c:3577
usb_audio_probe+0x1622/0x2090 sound/usb/card.c:883
usb_probe_interface+0x5c0/0xaf0 drivers/usb/core/driver.c:396
really_probe+0x24e/0xb60 drivers/base/dd.c:595
__driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:755
driver_probe_device+0x50/0x420 drivers/base/dd.c:785
__device_attach_driver+0x2b9/0x500 drivers/base/dd.c:907
bus_for_each_drv+0x183/0x200 drivers/base/bus.c:427
__device_attach+0x359/0x570 drivers/base/dd.c:979
bus_probe_device+0xba/0x1e0 drivers/base/bus.c:487
device_add+0xb48/0xfd0 drivers/base/core.c:3415
usb_set_configuration+0x19dd/0x2020 drivers/usb/core/message.c:2165
usb_generic_driver_probe+0x84/0x140 drivers/usb/core/generic.c:238
usb_probe_device+0x130/0x260 drivers/usb/core/driver.c:293
really_probe+0x24e/0xb60 drivers/base/dd.c:595
__driver_probe_device+0x1a2/0x3d0 drivers/base/dd.c:755
driver_probe_device+0x50/0x420 drivers/base/dd.c:785
__device_attach_driver+0x2b9/0x500 drivers/base/dd.c:907
bus_for_each_drv+0x183/0x200 drivers/base/bus.c:427
__device_attach+0x359/0x570 drivers/base/dd.c:979
bus_probe_device+0xba/0x1e0 drivers/base/bus.c:487
device_add+0xb48/0xfd0 drivers/base/core.c:3415
usb_new_device+0xc17/0x18e0 drivers/usb/core/hub.c:2593
hub_port_connect drivers/usb/core/hub.c:5455 [inline]
hub_port_connect_change drivers/usb/core/hub.c:5595 [inline]
port_event drivers/usb/core/hub.c:5741 [inline]
hub_event+0x2cdf/0x54c0 drivers/usb/core/hub.c:5823
process_one_work+0x8a1/0x10c0 kernel/workqueue.c:2310
worker_thread+0xaca/0x1280 kernel/workqueue.c:2457
kthread+0x3f6/0x4f0 kernel/kthread.c:334
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287
</TASK>
================================================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Sep 22, 2024, 2:55:24 PMSep 22
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following issue on:

HEAD commit: 3a5928702e71 Linux 5.15.167
git tree: linux-5.15.y
console output: https://syzkaller.appspot.com/x/log.txt?x=10fe3ca9980000
kernel config: https://syzkaller.appspot.com/x/.config?x=4d3fd5cca89ae935
dashboard link: https://syzkaller.appspot.com/bug?extid=dbad4fcfae2c7bfc2af8
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=16e8219f980000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12021c27980000
usb 1-1: config 1 has 1 interface, different from the descriptor's value: 3
usb 1-1: New USB device found, idVendor=08b7, idProduct=0000, bcdDevice= 0.00
usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=3
usb 1-1: SerialNumber: syz
usb 1-1: 0:2 : does not exist
================================================================================
UBSAN: shift-out-of-bounds in sound/usb/mixer.c:2035:20
shift exponent 41 is too large for 32-bit type 'int'
CPU: 1 PID: 3566 Comm: kworker/1:3 Not tainted 5.15.167-syzkaller #0
Kernel panic - not


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

syzbot

unread,
Sep 27, 2024, 11:32:04 PMSep 27
to syzkaller...@googlegroups.com
syzbot suspects this issue could be fixed by backporting the following commit:

commit 2f38cf730caedaeacdefb7ff35b0a3c1168117f9
git tree: upstream
Author: Takashi Iwai <ti...@suse.de>
Date: Mon Jul 15 12:35:54 2024 +0000

ALSA: usb: Fix UBSAN warning in parse_audio_unit()

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=16d25507980000
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=1155d880580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11f64107980000


Please keep in mind that other backports might be required as well.

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Reply all
Reply to author
Forward
0 new messages