------------[ cut here ]------------ refcount_t: addition on 0; use-after-free. WARNING: lib/refcount.c:25 at refcount_warn_saturate+0x111/0x130 lib/refcount.c:25, CPU#2: syz-executor/6178 Modules linked in: CPU: 2 UID: 0 PID: 6178 Comm: syz-executor Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 RIP: 0010:refcount_warn_saturate+0x111/0x130 lib/refcount.c:25 Code: cc e8 23 e1 ed fc 48 8d 3d 4c fe 11 0c 67 48 0f b9 3a e8 12 e1 ed fc 5b 5d e9 8b d7 9f 06 e8 06 e1 ed fc 48 8d 3d 3f fe 11 0c <67> 48 0f b9 3a e8 f5 e0 ed fc 5b 5d c3 cc cc cc cc 48 89 df e8 46 RSP: 0018:ffffc900031cfb90 EFLAGS: 00010293 RAX: 0000000000000000 RBX: ffffffff9ba2be60 RCX: ffffffff851bcaab RDX: ffff8880247b4a80 RSI: ffffffff851bcb5a RDI: ffffffff912dc9a0 RBP: 0000000000000002 R08: 0000000000000005 R09: 0000000000000004 R10: 0000000000000002 R11: 0000000000000000 R12: 0000000000000003 R13: 0000000000000000 R14: 0000000000000002 R15: 0000000000000004 FS: 0000000000000000(0000) GS:ffff888096de3000(0063) knlGS:000000005849a480 CS: 0010 DS: 002b ES: 002b CR0: 0000000080050033 CR2: 00000000f50ab669 CR3: 000000004230e000 CR4: 0000000000352ef0 Call Trace: __refcount_add include/linux/refcount.h:289 [inline] __refcount_inc include/linux/refcount.h:366 [inline] refcount_inc include/linux/refcount.h:383 [inline] new_device_store+0x682/0x700 drivers/net/netdevsim/bus.c:197 bus_attr_store+0x74/0xb0 drivers/base/bus.c:172 sysfs_kf_write+0xf2/0x150 fs/sysfs/file.c:145 kernfs_fop_write_iter+0x3e0/0x5f0 fs/kernfs/file.c:345 new_sync_write fs/read_write.c:595 [inline] vfs_write+0x6ac/0x1050 fs/read_write.c:687 ksys_write+0x12a/0x250 fs/read_write.c:739 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] do_int80_emulation+0x14b/0x720 arch/x86/entry/syscall_32.c:172 asm_int80_emulation+0x1a/0x20 arch/x86/include/asm/idtentry.h:598 RIP: 0023:0xf710736b Code: 57 56 53 8b 44 24 14 f6 00 08 75 23 8b 44 24 18 8b 5c 24 1c 8b 4c 24 20 8b 54 24 24 8b 74 24 28 8b 7c 24 2c 8b 6c 24 30 cd 80 <5b> 5e 5f 5d c3 5b 5e 5f 5d e9 f7 a1 ff ff 66 90 66 90 66 90 90 53 RSP: 002b:00000000ffe975ac EFLAGS: 00000246 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 00000000ffe97670 RDX: 0000000000000003 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 ---------------- Code disassembly (best guess): 0: cc int3 1: e8 23 e1 ed fc call 0xfcede129 6: 48 8d 3d 4c fe 11 0c lea 0xc11fe4c(%rip),%rdi # 0xc11fe59 d: 67 48 0f b9 3a ud1 (%edx),%rdi 12: e8 12 e1 ed fc call 0xfcede129 17: 5b pop %rbx 18: 5d pop %rbp 19: e9 8b d7 9f 06 jmp 0x69fd7a9 1e: e8 06 e1 ed fc call 0xfcede129 23: 48 8d 3d 3f fe 11 0c lea 0xc11fe3f(%rip),%rdi # 0xc11fe69 * 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction 2f: e8 f5 e0 ed fc call 0xfcede129 34: 5b pop %rbx 35: 5d pop %rbp 36: c3 ret 37: cc int3 38: cc int3 39: cc int3 3a: cc int3 3b: 48 89 df mov %rbx,%rdi 3e: e8 .byte 0xe8 3f: 46 rex.RX