syzbot


UBSAN: array-index-out-of-bounds in pvr2_i2c_core_init

Status: fixed on 2023/02/24 13:50
Subsystems: pvrusb2 usb
[Documentation on labels]
Reported-by: syzbot+1a247e36149ffd709a9b@syzkaller.appspotmail.com
Fix commit: 471bec68457a media: pvrusb2: fix array-index-out-of-bounds in pvr2_i2c_core_init
First crash: 735d, last: 700d
Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: WARNING in pvr2_i2c_core_done (log)
Repro: C syz .config
  
Discussions (10)
Title Replies (including bot) Last reply
[PATCH 5.17 000/772] 5.17.14-rc1 review 793 (793) 2022/06/20 15:05
[PATCH 5.10 000/452] 5.10.121-rc1 review 474 (474) 2022/06/16 13:09
[PATCH 5.4 000/411] 5.4.198-rc1 review 417 (417) 2022/06/14 15:17
[PATCH 4.19 000/287] 4.19.247-rc1 review 293 (293) 2022/06/14 10:27
[PATCH 4.9 000/167] 4.9.318-rc1 review 174 (174) 2022/06/14 07:52
[PATCH 4.14 000/218] 4.14.283-rc1 review 222 (222) 2022/06/14 06:38
[PATCH 5.18 000/879] 5.18.3-rc1 review 893 (893) 2022/06/09 06:12
[PATCH 5.15 000/667] 5.15.46-rc1 review 678 (678) 2022/06/09 00:23
[PATCH] media: pvrusb2: fix array-index-out-of-bounds in pvr2_i2c_core_init 1 (1) 2022/04/15 21:24
[syzbot] UBSAN: array-index-out-of-bounds in pvr2_i2c_core_init 2 (5) 2022/04/14 23:31
Last patch testing requests (3)
Created Duration User Patch Repo Result
2022/09/07 11:27 17m retest repro https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing OK log
2022/04/14 20:18 16m paskripkin@gmail.com patch upstream OK
2022/04/14 20:04 8m paskripkin@gmail.com patch upstream report log
Fix bisection attempts (1)
Created Duration User Patch Repo Result
2022/05/10 22:44 21m bisect fix upstream job log (0) log

Sample crash report:
pvrusb2: You need to resolve the failing condition before this driver can function.  There should be some earlier messages giving more information about the problem.
pvrusb2: Invalid write control endpoint
================================================================================
UBSAN: array-index-out-of-bounds in drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c:602:13
index -1 is out of range for type 'int [20]'
CPU: 0 PID: 1959 Comm: pvrusb2-context Not tainted 5.18.0-rc1-syzkaller-00401-g4ea3c6425269 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 ubsan_epilogue+0xb/0x50 lib/ubsan.c:151
 __ubsan_handle_out_of_bounds.cold+0x62/0x6c lib/ubsan.c:283
 pvr2_i2c_core_init+0xc7d/0xd30 drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c:602
 pvr2_hdw_setup_low drivers/media/usb/pvrusb2/pvrusb2-hdw.c:2134 [inline]
 pvr2_hdw_setup drivers/media/usb/pvrusb2/pvrusb2-hdw.c:2261 [inline]
 pvr2_hdw_initialize+0x787/0x37d0 drivers/media/usb/pvrusb2/pvrusb2-hdw.c:2338
 pvr2_context_check drivers/media/usb/pvrusb2/pvrusb2-context.c:109 [inline]
 pvr2_context_thread_func+0x250/0x850 drivers/media/usb/pvrusb2/pvrusb2-context.c:158
 kthread+0x2e9/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
 </TASK>
================================================================================
Kernel panic - not syncing: panic_on_warn set ...
CPU: 0 PID: 1959 Comm: pvrusb2-context Not tainted 5.18.0-rc1-syzkaller-00401-g4ea3c6425269 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106
 panic+0x2d7/0x636 kernel/panic.c:250
 ubsan_epilogue+0x4a/0x50 lib/ubsan.c:158
 __ubsan_handle_out_of_bounds.cold+0x62/0x6c lib/ubsan.c:283
 pvr2_i2c_core_init+0xc7d/0xd30 drivers/media/usb/pvrusb2/pvrusb2-i2c-core.c:602
 pvr2_hdw_setup_low drivers/media/usb/pvrusb2/pvrusb2-hdw.c:2134 [inline]
 pvr2_hdw_setup drivers/media/usb/pvrusb2/pvrusb2-hdw.c:2261 [inline]
 pvr2_hdw_initialize+0x787/0x37d0 drivers/media/usb/pvrusb2/pvrusb2-hdw.c:2338
 pvr2_context_check drivers/media/usb/pvrusb2/pvrusb2-context.c:109 [inline]
 pvr2_context_thread_func+0x250/0x850 drivers/media/usb/pvrusb2/pvrusb2-context.c:158
 kthread+0x2e9/0x3a0 kernel/kthread.c:376
 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298
 </TASK>
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2022/04/10 22:44 upstream 4ea3c6425269 e22c3da3 .config console log report syz C ci-upstream-kasan-gce UBSAN: array-index-out-of-bounds in pvr2_i2c_core_init
2022/04/10 19:48 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 312310928417 e22c3da3 .config console log report syz C ci2-upstream-usb UBSAN: array-index-out-of-bounds in pvr2_i2c_core_init
2022/05/16 09:15 upstream 42226c989789 744a39e2 .config console log report info ci-upstream-kasan-gce-root UBSAN: array-index-out-of-bounds in pvr2_i2c_core_init
2022/04/10 18:44 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing 312310928417 e22c3da3 .config console log report info ci2-upstream-usb UBSAN: array-index-out-of-bounds in pvr2_i2c_core_init
* Struck through repros no longer work on HEAD.