syzbot


KASAN: null-ptr-deref Write in video_usercopy
Status: upstream: reported C repro on 2020/01/08 08:54
Reported-by: syzbot+9240c422be249a8422bd@syzkaller.appspotmail.com
First crash: 869d, last: 868d

Cause bisection: introduced by (bisect log) :
commit c8ef1a6076bfb986052ff8fd8f5eb3b3a3f1048e
Author: Arnd Bergmann <arnd@arndb.de>
Date: Mon Dec 16 14:15:02 2019 +0000

  media: v4l2-core: split out data copy from video_usercopy

Crash: KASAN: null-ptr-deref Write in video_usercopy (log)
Repro: C syz .config
Patch testing requests:
Created Duration User Patch Repo Result
2021/03/15 01:45 15m ducheng2@gmail.com git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next-history.git master OK
2020/10/31 23:03 18m anant.thazhemadam@gmail.com https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master OK

Sample crash report:
==================================================================
BUG: KASAN: null-ptr-deref in memset include/linux/string.h:411 [inline]
BUG: KASAN: null-ptr-deref in video_get_user+0x67f/0x890 drivers/media/v4l2-core/v4l2-ioctl.c:3053
Write of size 4096 at addr 0000000000000000 by task syz-executor990/9864

CPU: 0 PID: 9864 Comm: syz-executor990 Not tainted 5.5.0-rc5-next-20200108-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x197/0x210 lib/dump_stack.c:118
 __kasan_report.cold+0x5/0x32 mm/kasan/report.c:510
 kasan_report+0x12/0x20 mm/kasan/common.c:641
 check_memory_region_inline mm/kasan/generic.c:185 [inline]
 check_memory_region+0x134/0x1a0 mm/kasan/generic.c:192
 memset+0x24/0x40 mm/kasan/common.c:108
 memset include/linux/string.h:411 [inline]
 video_get_user+0x67f/0x890 drivers/media/v4l2-core/v4l2-ioctl.c:3053
 video_usercopy+0x21f/0x10b0 drivers/media/v4l2-core/v4l2-ioctl.c:3210
 video_ioctl2+0x2d/0x35 drivers/media/v4l2-core/v4l2-ioctl.c:3274
 v4l2_ioctl+0x1ac/0x230 drivers/media/v4l2-core/v4l2-dev.c:360
 vfs_ioctl fs/ioctl.c:47 [inline]
 ksys_ioctl+0x123/0x180 fs/ioctl.c:747
 __do_sys_ioctl fs/ioctl.c:756 [inline]
 __se_sys_ioctl fs/ioctl.c:754 [inline]
 __x64_sys_ioctl+0x73/0xb0 fs/ioctl.c:754
 do_syscall_64+0xfa/0x790 arch/x86/entry/common.c:294
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x443df9
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 7b d8 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffe2e6f89b8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000004002e0 RCX: 0000000000443df9
RDX: 0000000000000000 RSI: 0000001010008913 RDI: 0000000000000003
RBP: 00000000006ce018 R08: 0000000000000000 R09: 00000000004002e0
R10: 000000000000000f R11: 0000000000000246 R12: 0000000000401b00
R13: 0000000000401b90 R14: 0000000000000000 R15: 0000000000000000
==================================================================

Crashes (2):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-linux-next-kasan-gce-root 2020/01/09 00:22 linux-next 4becfd1b26ef ddc3e859 .config log report syz C
ci-upstream-linux-next-kasan-gce-root 2020/01/08 02:23 linux-next 264673852033 6738e0b3 .config log report syz C