syzbot
kernel BUG in v4l2_device_put
Status:
upstream: reported C repro on 2026/10/22 00:29
Subsystems:
media
usb
Labels:
prio:high
[Documentation on labels]
Reported-by: syzbot+809dfc586f33fc44b6ac@syzkaller.appspotmail.com
Fix commit:
media: em28xx: check dev->disconnected in em28xx_v4l2_open()
media: em28xx: clear v4l2_dev.mdev on media device unregister
Patched on: [ci-upstream-linux-next-kasan-gce-root ci-upstream-rust-kasan-gce], missing on: [ci-qemu-gce-upstream-auto ci-qemu-native-arm64-kvm ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 24d, last: 14h00m
▶
▼
Last patch testing requests (6)
Sample crash report:
refcount_t: underflow; use-after-free.
------------[ cut here ]------------
kernel BUG at lib/refcount.c:37!
Oops: invalid opcode: 0000 [#1] SMP KASAN PTI
CPU: 0 UID: 0 PID: 8909 Comm: v4l_id Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/06/2026
RIP: 0010:refcount_warn_saturate+0x104/0x110 lib/refcount.c:37
Code: 5d ff ff ff e8 3d 79 d9 fc 48 c7 c7 60 99 8c 8c e8 41 1a 38 fc 90 0f 0b e8 29 79 d9 fc 48 c7 c7 e0 99 8c 8c e8 2d 1a 38 fc 90 <0f> 0b 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 90
RSP: 0018:ffffc900032afcc0 EFLAGS: 00010246
RAX: 0000000000000026 RBX: 0000000000000003 RCX: ba915b8b9f014100
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffff9014c6ab R09: 1ffffffff20298d5
R10: dffffc0000000000 R11: fffffbfff20298d6 R12: 1ffffffff1970a6c
R13: dffffc0000000000 R14: ffff88802c1040b0 R15: ffffffff88287740
FS: 00007f530f5d9880(0000) GS:ffff888123408000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055a6bdf2164d CR3: 0000000073ce4000 CR4: 00000000003526f0
Call Trace:
<TASK>
__refcount_sub_and_test include/linux/refcount.h:400 [inline]
__refcount_dec_and_test include/linux/refcount.h:432 [inline]
refcount_dec_and_test include/linux/refcount.h:450 [inline]
kref_put include/linux/kref.h:64 [inline]
v4l2_device_put+0xc2/0xd0 drivers/media/v4l2-core/v4l2-device.c:56
device_release+0xc4/0x1f0 drivers/base/core.c:-1
kobject_cleanup lib/kobject.c:689 [inline]
kobject_release lib/kobject.c:720 [inline]
kref_put include/linux/kref.h:65 [inline]
kobject_put+0x222/0x550 lib/kobject.c:737
video_put drivers/media/v4l2-core/v4l2-dev.c:173 [inline]
v4l2_release+0x273/0x350 drivers/media/v4l2-core/v4l2-dev.c:480
__fput+0x408/0xa40 fs/file_table.c:512
fput_close_sync+0x11f/0x240 fs/file_table.c:618
filp_close_sync fs/open.c:1574 [inline]
__do_sys_close fs/open.c:1597 [inline]
__se_sys_close+0xa2/0x160 fs/open.c:1584
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x16a/0x530 arch/x86/entry/syscall_64.c:89
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f530eea7407
Code: 48 89 fa 4c 89 df e8 38 aa 00 00 8b 93 08 03 00 00 59 5e 48 83 f8 fc 74 1a 5b c3 0f 1f 84 00 00 00 00 00 48 8b 44 24 10 0f 05 <5b> c3 0f 1f 80 00 00 00 00 83 e2 39 83 fa 08 75 de e8 23 ff ff ff
RSP: 002b:00007ffdcd953040 EFLAGS: 00000202 ORIG_RAX: 0000000000000003
RAX: ffffffffffffffda RBX: 00007f530f5d9880 RCX: 00007f530eea7407
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003
RBP: 00007f530f5d96e8 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000013
R13: 00007ffdcd953270 R14: 00007f530f740000 R15: 000055a6bdf254d8
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:refcount_warn_saturate+0x104/0x110 lib/refcount.c:37
Code: 5d ff ff ff e8 3d 79 d9 fc 48 c7 c7 60 99 8c 8c e8 41 1a 38 fc 90 0f 0b e8 29 79 d9 fc 48 c7 c7 e0 99 8c 8c e8 2d 1a 38 fc 90 <0f> 0b 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90 90 90
RSP: 0018:ffffc900032afcc0 EFLAGS: 00010246
RAX: 0000000000000026 RBX: 0000000000000003 RCX: ba915b8b9f014100
RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffff9014c6ab R09: 1ffffffff20298d5
R10: dffffc0000000000 R11: fffffbfff20298d6 R12: 1ffffffff1970a6c
R13: dffffc0000000000 R14: ffff88802c1040b0 R15: ffffffff88287740
FS: 00007f530f5d9880(0000) GS:ffff888123408000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000031863fff CR3: 0000000073ce4000 CR4: 00000000003526f0
* Struck through repros no longer work on HEAD.