syzbot


WARNING: refcount bug in i2c_get_adapter (2)

Status: upstream: reported on 2026/04/22 20:31
Subsystems: i2c
[Documentation on labels]
Reported-by: syzbot+c0291c8c9aaa473c7721@syzkaller.appspotmail.com
First crash: 47d, last: 3d07h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [i2c?] WARNING: refcount bug in i2c_get_adapter (2) 1 (2) 2026/04/25 21:45
Similar bugs (1)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream WARNING: refcount bug in i2c_get_adapter i2c 13 2 190d 190d 0/29 auto-obsoleted due to no activity on 2026/02/04 07:13

Sample crash report:
------------[ cut here ]------------
refcount_t: addition on 0; use-after-free.
WARNING: lib/refcount.c:25 at refcount_warn_saturate+0x9f/0x110 lib/refcount.c:25, CPU#1: syz.5.7731/31061
Modules linked in:
CPU: 1 UID: 0 PID: 31061 Comm: syz.5.7731 Tainted: G             L      syzkaller #0 PREEMPT_{RT,(full)} 
Tainted: [L]=SOFTLOCKUP
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/18/2026
RIP: 0010:refcount_warn_saturate+0x9f/0x110 lib/refcount.c:25
Code: eb 66 85 db 74 3e 83 fb 01 75 4c e8 db 10 23 fd 48 8d 3d 24 d0 f1 0a 67 48 0f b9 3a eb 4a e8 c8 10 23 fd 48 8d 3d 21 d0 f1 0a <67> 48 0f b9 3a eb 37 e8 b5 10 23 fd 48 8d 3d 1e d0 f1 0a 67 48 0f
RSP: 0000:ffffc90004f9f6d8 EFLAGS: 00010287
RAX: ffffffff84a16078 RBX: 0000000000000002 RCX: 0000000000080000
RDX: ffffc9000fb0c000 RSI: 000000000000086b RDI: ffffffff8f9330a0
RBP: 0000000000000000 R08: ffff888040148000 R09: 0000000000000005
R10: 0000000000000100 R11: 0000000000000004 R12: ffffffff8c05d7c8
R13: dffffc0000000000 R14: ffff8880774b5188 R15: dffffc0000000000
FS:  00007f64898d66c0(0000) GS:ffff888126279000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b31923ffc CR3: 00000000859d8000 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+0xfa/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:603
 chrdev_open+0x4d0/0x5f0 fs/char_dev.c:411
 do_dentry_open+0x83d/0x13e0 fs/open.c:947
 vfs_open+0x3b/0x350 fs/open.c:1079
 do_open fs/namei.c:4699 [inline]
 path_openat+0x2e43/0x38a0 fs/namei.c:4858
 do_file_open+0x23e/0x4a0 fs/namei.c:4887
 do_sys_openat2+0x113/0x200 fs/open.c:1364
 do_sys_open fs/open.c:1370 [inline]
 __do_sys_openat fs/open.c:1386 [inline]
 __se_sys_openat fs/open.c:1381 [inline]
 __x64_sys_openat+0x138/0x170 fs/open.c:1381
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0x15f/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f648b63d60e
Code: 08 0f 85 a5 a8 ff ff 49 89 fb 48 89 f0 48 89 d7 48 89 ce 4c 89 c2 4d 89 ca 4c 8b 44 24 08 4c 8b 4c 24 10 4c 89 5c 24 08 0f 05 <c3> 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 80 00 00 00 00 48 83 ec 08
RSP: 002b:00007f64898d5b28 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f64898d66c0 RCX: 00007f648b63d60e
RDX: 0000000000002603 RSI: 00007f64898d5c00 RDI: ffffffffffffff9c
RBP: 00007f64898d5c00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: cccccccccccccccd
R13: 00007f648b8f6038 R14: 00007f648b8f5fa0 R15: 00007fff94260ee8
 </TASK>
----------------
Code disassembly (best guess):
   0:	eb 66                	jmp    0x68
   2:	85 db                	test   %ebx,%ebx
   4:	74 3e                	je     0x44
   6:	83 fb 01             	cmp    $0x1,%ebx
   9:	75 4c                	jne    0x57
   b:	e8 db 10 23 fd       	call   0xfd2310eb
  10:	48 8d 3d 24 d0 f1 0a 	lea    0xaf1d024(%rip),%rdi        # 0xaf1d03b
  17:	67 48 0f b9 3a       	ud1    (%edx),%rdi
  1c:	eb 4a                	jmp    0x68
  1e:	e8 c8 10 23 fd       	call   0xfd2310eb
  23:	48 8d 3d 21 d0 f1 0a 	lea    0xaf1d021(%rip),%rdi        # 0xaf1d04b
* 2a:	67 48 0f b9 3a       	ud1    (%edx),%rdi <-- trapping instruction
  2f:	eb 37                	jmp    0x68
  31:	e8 b5 10 23 fd       	call   0xfd2310eb
  36:	48 8d 3d 1e d0 f1 0a 	lea    0xaf1d01e(%rip),%rdi        # 0xaf1d05b
  3d:	67                   	addr32
  3e:	48                   	rex.W
  3f:	0f                   	.byte 0xf

Crashes (9):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/05/02 01:32 upstream 6fe0be6dc7fa 753c55b9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: refcount bug in i2c_get_adapter
2026/05/01 07:38 upstream 26fd6bff2c05 753c55b9 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: refcount bug in i2c_get_adapter
2026/04/30 05:06 upstream 57b8e2d666a3 005438fc .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: refcount bug in i2c_get_adapter
2026/04/12 07:56 upstream e753c16cb3dd 38c8e246 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: refcount bug in i2c_get_adapter
2026/03/20 20:09 upstream c612261bedd6 5b92003d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: refcount bug in i2c_get_adapter
2026/03/19 07:51 upstream 8a30aeb0d1b4 0199f9a1 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root WARNING: refcount bug in i2c_get_adapter
2026/04/27 14:32 upstream 254f49634ee1 0f700595 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-386 WARNING: refcount bug in i2c_get_adapter
2026/04/22 20:30 linux-next 70c8a7ec6715 4595e353 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce WARNING: refcount bug in i2c_get_adapter
2026/04/18 14:44 linux-next c7275b05bc42 303e2802 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-rust-kasan-gce WARNING: refcount bug in i2c_get_adapter
* Struck through repros no longer work on HEAD.