syzbot


general protection fault in vb2_mmap

Status: fixed on 2019/11/11 16:48
Subsystems: media
[Documentation on labels]
Reported-by: syzbot+52e5bf0ebfa66092937a@syzkaller.appspotmail.com
Fix commit: cd26d1c4d1bc media: vb2: vb2_mmap: move lock up
First crash: 1993d, last: 1949d
Cause bisection: the issue happens on the oldest tested release (bisect log)
Crash: BUG: unable to handle kernel NULL pointer dereference in vb2_mmap (log)
Repro: C syz .config
  
Fix bisection: fixed by (bisect log) :
commit cd26d1c4d1bc947b56ae404998ae2276df7b39b7
Author: Hans Verkuil <hverkuil@xs4all.nl>
Date: Tue Nov 13 14:06:46 2018 +0000

  media: vb2: vb2_mmap: move lock up

  
Discussions (3)
Title Replies (including bot) Last reply
general protection fault in vb2_mmap 1 (5) 2019/11/11 14:02
Reminder: 35 open syzbot bugs in media subsystem 1 (1) 2019/07/24 01:39
Reminder: 28 open syzbot bugs in media subsystem 1 (1) 2019/06/27 03:53

Sample crash report:
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 7023 Comm: syz-executor295 Not tainted 4.20.0-rc1+ #111
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
RIP: 0010:__find_plane_by_offset drivers/media/common/videobuf2/videobuf2-core.c:2006 [inline]
RIP: 0010:vb2_mmap+0x23c/0x6f0 drivers/media/common/videobuf2/videobuf2-core.c:2128
Code: 80 3c 10 00 0f 85 1b 04 00 00 48 b9 00 00 00 00 00 fc ff df 48 8b 45 b8 48 8b 00 48 8d 78 14 48 89 45 d0 48 89 f8 48 c1 e8 03 <0f> b6 14 08 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 fa
RSP: 0018:ffff8881c3f477d0 EFLAGS: 00010203
RAX: 0000000000000002 RBX: 000000000000000a RCX: dffffc0000000000
RDX: dffffc0000000000 RSI: ffffffff854ccb60 RDI: 0000000000000014
RBP: ffff8881c3f47820 R08: ffff8881c8c8e0c0 R09: ffffed1039b584be
R10: ffffed1039b584be R11: ffff8881cdac25f7 R12: 0000000000000000
R13: 0000000000000001 R14: 0000000020a00000 R15: ffff8881cb147268
FS:  0000000001a87880(0000) GS:ffff8881dae00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000006cf090 CR3: 00000001b0919000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 vb2_fop_mmap+0x4b/0x70 drivers/media/common/videobuf2/videobuf2-v4l2.c:999
 v4l2_mmap+0x153/0x200 drivers/media/v4l2-core/v4l2-dev.c:401
 call_mmap include/linux/fs.h:1862 [inline]
 mmap_region+0xe85/0x1cd0 mm/mmap.c:1786
 do_mmap+0xa22/0x1230 mm/mmap.c:1559
 do_mmap_pgoff include/linux/mm.h:2328 [inline]
 vm_mmap_pgoff+0x213/0x2c0 mm/util.c:350
 ksys_mmap_pgoff+0x4da/0x660 mm/mmap.c:1609
 __do_sys_mmap arch/x86/kernel/sys_x86_64.c:100 [inline]
 __se_sys_mmap arch/x86/kernel/sys_x86_64.c:91 [inline]
 __x64_sys_mmap+0xe9/0x1b0 arch/x86/kernel/sys_x86_64.c:91
 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x444c09
Code: e8 ac e8 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 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 2b ce fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffd2c922fb8 EFLAGS: 00000212 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000444c09
RDX: 00000000ffffffff RSI: 0000000000600000 RDI: 0000000020a00000
RBP: 0000000000000000 R08: 0000000000000003 R09: 0000000020a00000
R10: 0000000000000011 R11: 0000000000000212 R12: 000000000000f6c5
R13: 0000000000401f50 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace 3c9d5b0c0b21252b ]---
RIP: 0010:__find_plane_by_offset drivers/media/common/videobuf2/videobuf2-core.c:2006 [inline]
RIP: 0010:vb2_mmap+0x23c/0x6f0 drivers/media/common/videobuf2/videobuf2-core.c:2128
Code: 80 3c 10 00 0f 85 1b 04 00 00 48 b9 00 00 00 00 00 fc ff df 48 8b 45 b8 48 8b 00 48 8d 78 14 48 89 45 d0 48 89 f8 48 c1 e8 03 <0f> b6 14 08 48 89 f8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 fa
RSP: 0018:ffff8881c3f477d0 EFLAGS: 00010203
RAX: 0000000000000002 RBX: 000000000000000a RCX: dffffc0000000000
RDX: dffffc0000000000 RSI: ffffffff854ccb60 RDI: 0000000000000014
RBP: ffff8881c3f47820 R08: ffff8881c8c8e0c0 R09: ffffed1039b584be
R10: ffffed1039b584be R11: ffff8881cdac25f7 R12: 0000000000000000
R13: 0000000000000001 R14: 0000000020a00000 R15: ffff8881cb147268
FS:  0000000001a87880(0000) GS:ffff8881dae00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000414ca0 CR3: 00000001b0919000 CR4: 00000000001406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (21):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2018/11/12 06:12 upstream e12e00e388de 7b5f8621 .config console log report syz C ci-upstream-kasan-gce-selinux-root
2018/11/12 04:09 upstream e12e00e388de 7b5f8621 .config console log report syz C ci-upstream-kasan-gce-smack-root
2018/11/11 23:41 linux-next 442b8cea2477 7b5f8621 .config console log report syz C ci-upstream-linux-next-kasan-gce-root
2018/12/25 11:42 upstream 8fe28cb58bcb 8a41a0ad .config console log report ci-upstream-kasan-gce
2018/12/24 15:24 upstream 8fe28cb58bcb be79df56 .config console log report ci-upstream-kasan-gce
2018/12/22 06:16 upstream 5092adb2272e 603b5124 .config console log report ci-upstream-kasan-gce
2018/12/18 20:29 upstream ddfbab46539f 4edaba93 .config console log report ci-upstream-kasan-gce-root
2018/12/17 17:19 upstream 7566ec393f41 def91db3 .config console log report ci-upstream-kasan-gce-root
2018/12/09 05:45 upstream 8214bdf7d3e6 c7918378 .config console log report ci-upstream-kasan-gce-smack-root
2018/12/05 06:46 upstream 0072a0c14d5b f162ad97 .config console log report ci-upstream-kasan-gce-selinux-root
2018/12/01 20:48 upstream d8f190ee836a 5a581673 .config console log report ci-upstream-kasan-gce-root
2018/11/14 10:42 upstream ccda4af0f4b9 5f5f6d14 .config console log report ci-upstream-kasan-gce
2018/11/11 23:10 upstream e255aee5b66c 7b5f8621 .config console log report ci-upstream-kasan-gce-selinux-root
2018/11/10 23:15 upstream ab6e1f378f54 f3c4e618 .config console log report ci-upstream-kasan-gce-selinux-root
2018/12/01 23:41 upstream d8f190ee836a 5a581673 .config console log report ci-upstream-kasan-gce-386
2018/11/24 18:50 upstream 7c98a4261827 ecc7c870 .config console log report ci-upstream-kasan-gce-386
2018/11/23 07:14 upstream edeca3a769ad 87815d9d .config console log report ci-upstream-kasan-gce-386
2018/11/16 14:57 upstream da5322e65940 f5e275d1 .config console log report ci-upstream-kasan-gce-386
2018/11/26 00:55 linux-next 442b8cea2477 3d3ec907 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/11/14 13:28 linux-next 442b8cea2477 5f5f6d14 .config console log report ci-upstream-linux-next-kasan-gce-root
2018/11/11 23:11 linux-next 442b8cea2477 7b5f8621 .config console log report ci-upstream-linux-next-kasan-gce-root
* Struck through repros no longer work on HEAD.