BUG: unable to handle kernel NULL pointer dereference at 0000000000000020 IP: refcount_dec_and_test arch/x86/include/asm/refcount.h:75 [inline] IP: vb2_vmalloc_put+0x9/0x60 drivers/media/v4l2-core/videobuf2-vmalloc.c:68 PGD 99a7c067 P4D 99a7c067 PUD 98c6b067 PMD 0 Oops: 0002 [#1] PREEMPT SMP KASAN Modules linked in: CPU: 1 PID: 3883 Comm: syz-executor.1 Not tainted 4.14.266-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 task: ffff88809c462240 task.stack: ffff888096e98000 RIP: 0010:refcount_dec_and_test arch/x86/include/asm/refcount.h:75 [inline] RIP: 0010:vb2_vmalloc_put+0x9/0x60 drivers/media/v4l2-core/videobuf2-vmalloc.c:68 RSP: 0018:ffff888096e9f900 EFLAGS: 00010297 RAX: ffff88809c462240 RBX: ffff8880a52da780 RCX: 1ffff1101388c562 RDX: 0000000000000000 RSI: ffff88809c462af0 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: ffff8880a52da794 R14: 0000000000000000 R15: ffffffff84c24b70 FS: 00007f60a5147700(0000) GS:ffff8880ba500000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000020 CR3: 00000000afca2000 CR4: 00000000003406e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __vb2_buf_mem_free+0xfa/0x1d0 drivers/media/v4l2-core/videobuf2-core.c:240 __vb2_free_mem drivers/media/v4l2-core/videobuf2-core.c:409 [inline] __vb2_queue_free+0x60d/0x7a0 drivers/media/v4l2-core/videobuf2-core.c:454 vb2_core_reqbufs+0x1cc/0x910 drivers/media/v4l2-core/videobuf2-core.c:687 vb2_ioctl_reqbufs+0x1b6/0x320 drivers/media/v4l2-core/videobuf2-v4l2.c:718 v4l_reqbufs drivers/media/v4l2-core/v4l2-ioctl.c:1863 [inline] v4l_reqbufs+0x98/0xc0 drivers/media/v4l2-core/v4l2-ioctl.c:1852 __video_do_ioctl+0x65b/0x6a0 drivers/media/v4l2-core/v4l2-ioctl.c:2738 video_usercopy+0xfd/0xe70 drivers/media/v4l2-core/v4l2-ioctl.c:2908 v4l2_ioctl+0x1bb/0x2f0 drivers/media/v4l2-core/v4l2-dev.c:360 vfs_ioctl fs/ioctl.c:46 [inline] file_ioctl fs/ioctl.c:500 [inline] do_vfs_ioctl+0x75a/0xff0 fs/ioctl.c:684 SYSC_ioctl fs/ioctl.c:701 [inline] SyS_ioctl+0x7f/0xb0 fs/ioctl.c:692 do_syscall_64+0x1d5/0x640 arch/x86/entry/common.c:292 entry_SYSCALL_64_after_hwframe+0x46/0xbb RIP: 0033:0x7f60a67d2059 RSP: 002b:00007f60a5147168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f60a68e4f60 RCX: 00007f60a67d2059 RDX: 0000000020000080 RSI: 00000000c0145608 RDI: 0000000000000003 RBP: 00007f60a682c08d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdfc7b390f R14: 00007f60a5147300 R15: 0000000000022000 Code: e9 ca fc ff ff e8 28 a5 bc fc e9 96 fc ff ff e8 4e a7 bc fc e9 fd fe ff ff 66 0f 1f 84 00 00 00 00 00 55 48 89 fd e8 37 f4 92 fc ff 4d 20 0f 88 34 62 5f 02 74 06 5d e9 25 f4 92 fc e8 20 f4 RIP: refcount_dec_and_test arch/x86/include/asm/refcount.h:75 [inline] RSP: ffff888096e9f900 RIP: vb2_vmalloc_put+0x9/0x60 drivers/media/v4l2-core/videobuf2-vmalloc.c:68 RSP: ffff888096e9f900 CR2: 0000000000000020 ---[ end trace dacc9cd9f7fca2fa ]--- ---------------- Code disassembly (best guess): 0: e9 ca fc ff ff jmpq 0xfffffccf 5: e8 28 a5 bc fc callq 0xfcbca532 a: e9 96 fc ff ff jmpq 0xfffffca5 f: e8 4e a7 bc fc callq 0xfcbca762 14: e9 fd fe ff ff jmpq 0xffffff16 19: 66 0f 1f 84 00 00 00 nopw 0x0(%rax,%rax,1) 20: 00 00 22: 55 push %rbp 23: 48 89 fd mov %rdi,%rbp 26: e8 37 f4 92 fc callq 0xfc92f462 * 2b: f0 ff 4d 20 lock decl 0x20(%rbp) <-- trapping instruction 2f: 0f 88 34 62 5f 02 js 0x25f6269 35: 74 06 je 0x3d 37: 5d pop %rbp 38: e9 25 f4 92 fc jmpq 0xfc92f462 3d: e8 .byte 0xe8 3e: 20 f4 and %dh,%ah