syzbot


WARNING: refcount bug in i2c_get_adapter

Status: moderation: reported on 2025/10/25 04:41
Subsystems: i2c
[Documentation on labels]
Reported-by: syzbot+310912aee5438db9d3b8@syzkaller.appspotmail.com
First crash: 5d14h, last: 5d14h

Sample crash report:
------------[ cut here ]------------
refcount_t: addition on 0; use-after-free.
WARNING: CPU: 1 PID: 6572 at lib/refcount.c:25 refcount_warn_saturate+0xfa/0x1d0 lib/refcount.c:25
Modules linked in:
CPU: 1 UID: 0 PID: 6572 Comm: syz.2.237 Not tainted syzkaller #0 PREEMPT_{RT,(full)} 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/2025
RIP: 0010:refcount_warn_saturate+0xfa/0x1d0 lib/refcount.c:25
Code: 00 00 e8 e9 f5 3d fd 5b 41 5e c3 cc cc cc cc cc e8 db f5 3d fd c6 05 b8 91 60 0a 01 90 48 c7 c7 a0 9a 3e 8b e8 e7 3d 02 fd 90 <0f> 0b 90 90 eb d7 e8 bb f5 3d fd c6 05 99 91 60 0a 01 90 48 c7 c7
RSP: 0018:ffffc9000cdef6d8 EFLAGS: 00010246
RAX: 07f404c01321b500 RBX: 0000000000000002 RCX: 0000000000080000
RDX: ffffc90005d09000 RSI: 00000000000008d8 RDI: 00000000000008d9
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: dffffc0000000000 R11: ffffed101712487b R12: ffffffff8b995c88
R13: dffffc0000000000 R14: ffff88805dd48390 R15: dffffc0000000000
FS:  00007fd67c35e6c0(0000) GS:ffff888126cc2000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b3001eff8 CR3: 000000003a534000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 __refcount_add include/linux/refcount.h:-1 [inline]
 __refcount_inc include/linux/refcount.h:366 [inline]
 refcount_inc include/linux/refcount.h:383 [inline]
 kref_get include/linux/kref.h:45 [inline]
 kobject_get+0xfd/0x120 lib/kobject.c:643
 i2c_get_adapter+0x6d/0xa0 drivers/i2c/i2c-core-base.c:2612
 i2cdev_open+0x48/0x190 drivers/i2c/i2c-dev.c:604
 chrdev_open+0x4cf/0x5e0 fs/char_dev.c:414
 do_dentry_open+0x9b1/0x1350 fs/open.c:965
 vfs_open+0x3b/0x350 fs/open.c:1097
 do_open fs/namei.c:3975 [inline]
 path_openat+0x2ef1/0x3840 fs/namei.c:4134
 do_filp_open+0x1fa/0x410 fs/namei.c:4161
 do_sys_openat2+0x121/0x1c0 fs/open.c:1437
 do_sys_open fs/open.c:1452 [inline]
 __do_sys_openat fs/open.c:1468 [inline]
 __se_sys_openat fs/open.c:1463 [inline]
 __x64_sys_openat+0x138/0x170 fs/open.c:1463
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fd67e0fd810
Code: 48 89 44 24 20 75 93 44 89 54 24 0c e8 69 95 02 00 44 8b 54 24 0c 89 da 48 89 ee 41 89 c0 bf 9c ff ff ff b8 01 01 00 00 0f 05 <48> 3d 00 f0 ff ff 77 38 44 89 c7 89 44 24 0c e8 bc 95 02 00 8b 44
RSP: 002b:00007fd67c35db70 EFLAGS: 00000293 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 0000000000002603 RCX: 00007fd67e0fd810
RDX: 0000000000002603 RSI: 00007fd67c35dc10 RDI: 00000000ffffff9c
RBP: 00007fd67c35dc10 R08: 0000000000000000 R09: 00232d6332692f76
R10: 0000000000000000 R11: 0000000000000293 R12: cccccccccccccccd
R13: 00007fd67e356038 R14: 00007fd67e355fa0 R15: 00007ffec547dee8
 </TASK>

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/10/21 04:38 upstream 211ddde0823f 9832ed61 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: refcount bug in i2c_get_adapter
* Struck through repros no longer work on HEAD.