syzbot


UBSAN: shift-out-of-bounds in std_validate

Status: fixed on 2021/04/09 19:46
Subsystems: media
[Documentation on labels]
Reported-by: syzbot+42d8c7c3d3e594b34346@syzkaller.appspotmail.com
Fix commit: 048c96e28674 media: v4l2-ctrls.c: fix shift-out-of-bounds in std_validate
First crash: 1189d, last: 1189d
Cause bisection: introduced by (bisect log) [release commit]:
commit 4d856f72c10ecb060868ed10ff1b1453943fc6c8
Author: Linus Torvalds <torvalds@linux-foundation.org>
Date: Sun Sep 15 21:19:32 2019 +0000

  Linux 5.3

Crash: UBSAN: undefined-behaviour in std_validate (log)
Repro: C syz .config
  
Discussions (8)
Title Replies (including bot) Last reply
[PATCH 5.10 000/102] 5.10.21-rc1 review 119 (119) 2021/03/08 13:21
[PATCH 5.11 000/104] 5.11.4-rc1 review 119 (119) 2021/03/07 11:37
[PATCH AUTOSEL 5.11 01/67] ath10k: prevent deinitializing NAPI twice 80 (80) 2021/03/06 17:52
[PATCH 5.4 00/72] 5.4.103-rc1 review 80 (80) 2021/03/06 16:33
[PATCH AUTOSEL 5.10 01/56] EDAC/amd64: Do not load on family 0x15, model 0x13 59 (59) 2021/03/05 12:40
[PATCH AUTOSEL 5.4 01/40] staging: fwserial: Fix error handling in fwserial_create 41 (41) 2021/02/24 13:20
UBSAN: shift-out-of-bounds in std_validate 1 (2) 2021/01/24 22:09
[PATCH 00/14] Fixes for smatch/sparse/sysbot/compiler warnings 17 (17) 2021/01/23 22:39

Sample crash report:
================================================================================
UBSAN: shift-out-of-bounds in drivers/media/v4l2-core/v4l2-ctrls.c:2168:36
shift exponent 100 is too large for 64-bit type 'long long unsigned int'
CPU: 0 PID: 8469 Comm: syz-executor534 Not tainted 5.11.0-rc4-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
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
 std_validate.cold+0x19/0x1e drivers/media/v4l2-core/v4l2-ctrls.c:2168
 validate_new drivers/media/v4l2-core/v4l2-ctrls.c:2477 [inline]
 set_ctrl+0x207/0x4a0 drivers/media/v4l2-core/v4l2-ctrls.c:4425
 set_ctrl_lock drivers/media/v4l2-core/v4l2-ctrls.c:4448 [inline]
 v4l2_s_ctrl+0x2fd/0x4f0 drivers/media/v4l2-core/v4l2-ctrls.c:4469
 v4l_s_ctrl+0x324/0x390 drivers/media/v4l2-core/v4l2-ioctl.c:2253
 __video_do_ioctl+0xb94/0xe20 drivers/media/v4l2-core/v4l2-ioctl.c:2993
 video_usercopy+0x23d/0x12d0 drivers/media/v4l2-core/v4l2-ioctl.c:3345
 v4l2_ioctl+0x1b3/0x250 drivers/media/v4l2-core/v4l2-dev.c:360
 vfs_ioctl fs/ioctl.c:48 [inline]
 __do_sys_ioctl fs/ioctl.c:753 [inline]
 __se_sys_ioctl fs/ioctl.c:739 [inline]
 __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739
 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x443ee9
Code: 18 89 d0 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 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 0f 83 fb d7 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffe02e7df08 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000004002e0 RCX: 0000000000443ee9
RDX: 0000000020000140 RSI: 00000000c008561c RDI: 0000000000000003
RBP: 00000000006ce018 R08: 0000000000000000 R09: 00000000004002e0
R10: 000000000000000f R11: 0000000000000246 R12: 0000000000401b70
R13: 0000000000401c00 R14: 0000000000000000 R15: 0000000000000000
================================================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2021/01/19 17:41 upstream 1e2a199f6ccd 63631df1 .config console log report syz C ci-upstream-kasan-gce-root UBSAN: shift-out-of-bounds in std_validate
2021/01/19 17:27 upstream 1e2a199f6ccd 63631df1 .config console log report info ci-upstream-kasan-gce-root UBSAN: shift-out-of-bounds in std_validate
* Struck through repros no longer work on HEAD.