syzbot


UBSAN: shift-out-of-bounds in mceusb_dev_recv

Status: fixed on 2021/04/09 19:46
Subsystems: media usb
[Documentation on labels]
Reported-by: syzbot+ec3b3128c576e109171d@syzkaller.appspotmail.com
Fix commit: 1b43bad31fb0 media: mceusb: Fix potential out-of-bounds shift
First crash: 1256d, last: 1190d
Discussions (5)
Title Replies (including bot) Last reply
[PATCH 5.10 000/663] 5.10.20-rc1 review 673 (673) 2021/03/05 18:03
[PATCH 5.4 000/340] 5.4.102-rc1 review 348 (348) 2021/03/04 09:26
[PATCH 5.11 000/775] 5.11.3-rc1 review 776 (776) 2021/03/01 16:15
[PATCH] media: mceusb: Fix potential out-of-bounds shift 2 (2) 2020/12/22 13:05
UBSAN: shift-out-of-bounds in mceusb_dev_recv 0 (1) 2020/12/19 18:14
Last patch testing requests (2)
Created Duration User Patch Repo Result
2021/01/09 18:41 16m anant.thazhemadam@gmail.com patch https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing report log
2021/01/09 18:38 13m anant.thazhemadam@gmail.com patch upstream report log

Sample crash report:
================================================================================
UBSAN: shift-out-of-bounds in drivers/media/rc/mceusb.c:1173:29
shift exponent 119 is too large for 32-bit type 'int'
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 5.11.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <IRQ>
 __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
 mceusb_handle_command drivers/media/rc/mceusb.c:1173 [inline]
 mceusb_process_ir_data drivers/media/rc/mceusb.c:1278 [inline]
 mceusb_dev_recv.cold+0x177/0x1d6 drivers/media/rc/mceusb.c:1376
 __usb_hcd_giveback_urb+0x2b0/0x5c0 drivers/usb/core/hcd.c:1656
 usb_hcd_giveback_urb+0x367/0x410 drivers/usb/core/hcd.c:1726
 dummy_timer+0x11f4/0x32a0 drivers/usb/gadget/udc/dummy_hcd.c:1971
 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1417
 expire_timers kernel/time/timer.c:1462 [inline]
 __run_timers.part.0+0x67c/0xa50 kernel/time/timer.c:1731
 __run_timers kernel/time/timer.c:1712 [inline]
 run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1744
 __do_softirq+0x2bc/0xa29 kernel/softirq.c:343
 asm_call_irq_on_stack+0xf/0x20
 </IRQ>
 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline]
 run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline]
 do_softirq_own_stack+0xaa/0xd0 arch/x86/kernel/irq_64.c:77
 invoke_softirq kernel/softirq.c:226 [inline]
 __irq_exit_rcu kernel/softirq.c:420 [inline]
 irq_exit_rcu+0x134/0x200 kernel/softirq.c:432
 sysvec_apic_timer_interrupt+0x4d/0x100 arch/x86/kernel/apic/apic.c:1096
 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:629
RIP: 0010:native_save_fl arch/x86/include/asm/irqflags.h:29 [inline]
RIP: 0010:arch_local_save_flags arch/x86/include/asm/irqflags.h:79 [inline]
RIP: 0010:arch_irqs_disabled arch/x86/include/asm/irqflags.h:169 [inline]
RIP: 0010:acpi_safe_halt drivers/acpi/processor_idle.c:111 [inline]
RIP: 0010:acpi_idle_do_entry+0x1c9/0x250 drivers/acpi/processor_idle.c:516
Code: cd aa 76 f8 84 db 75 ac e8 44 a4 76 f8 e8 bf 76 7c f8 e9 0c 00 00 00 e8 35 a4 76 f8 0f 00 2d 5e c2 ad 00 e8 29 a4 76 f8 fb f4 <9c> 5b 81 e3 00 02 00 00 fa 31 ff 48 89 de e8 04 ac 76 f8 48 85 db
RSP: 0018:ffffc90000d47d18 EFLAGS: 00000293
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: ffff888010dab780 RSI: ffffffff88fc1d27 RDI: 0000000000000000
RBP: ffff888140fc3064 R08: 0000000000000001 R09: 0000000000000001
R10: ffffffff81789408 R11: 0000000000000000 R12: 0000000000000001
R13: ffff888140fc3000 R14: ffff888140fc3064 R15: ffff88814366c004
 acpi_idle_enter+0x361/0x500 drivers/acpi/processor_idle.c:647
 cpuidle_enter_state+0x1b1/0xc80 drivers/cpuidle/cpuidle.c:237
 cpuidle_enter+0x4a/0xa0 drivers/cpuidle/cpuidle.c:351
 call_cpuidle kernel/sched/idle.c:158 [inline]
 cpuidle_idle_call kernel/sched/idle.c:239 [inline]
 do_idle+0x3e1/0x590 kernel/sched/idle.c:299
 cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:396
 start_secondary+0x274/0x350 arch/x86/kernel/smpboot.c:272
 secondary_startup_64_no_verify+0xb0/0xbb
================================================================================

Crashes (13):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/01/29 06:58 upstream e5ff2cb9cf67 7df34f59 .config console log report syz C ci-upstream-kasan-gce UBSAN: shift-out-of-bounds in mceusb_dev_recv
2020/12/17 17:49 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 5e60366d56c6 04201c06 .config console log report syz C ci2-upstream-usb
2021/02/22 02:18 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 55f62bc87347 a659b3f1 .config console log report info ci2-upstream-usb UBSAN: shift-out-of-bounds in mceusb_dev_recv
2021/02/21 14:43 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 55f62bc87347 3e5ed8b4 .config console log report info ci2-upstream-usb UBSAN: shift-out-of-bounds in mceusb_dev_recv
2021/02/09 14:20 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 4b049f55ed95 2bd9619f .config console log report info ci2-upstream-usb UBSAN: shift-out-of-bounds in mceusb_dev_recv
2021/02/08 18:44 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing d8c849037d93 2ce644fc .config console log report info ci2-upstream-usb UBSAN: shift-out-of-bounds in mceusb_dev_recv
2021/02/06 02:03 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 23e32a595e11 23a562df .config console log report info ci2-upstream-usb UBSAN: shift-out-of-bounds in mceusb_dev_recv
2021/02/05 05:46 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 8dc6e6dd1bee 23a562df .config console log report info ci2-upstream-usb UBSAN: shift-out-of-bounds in mceusb_dev_recv
2020/12/27 23:37 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing f838f8d2b694 2242f77f .config console log report info ci2-upstream-usb
2020/12/23 10:28 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 3644e2d2dda7 04201c06 .config console log report info ci2-upstream-usb
2020/12/22 06:41 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 3644e2d2dda7 04201c06 .config console log report info ci2-upstream-usb
2020/12/21 02:38 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 3644e2d2dda7 04201c06 .config console log report info ci2-upstream-usb
2020/12/17 17:06 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 5e60366d56c6 04201c06 .config console log report info ci2-upstream-usb
* Struck through repros no longer work on HEAD.