[moderation] [net?] WARNING: refcount bug in new_device_store

1 view
Skip to first unread message

syzbot

unread,
8:38 AM (10 hours ago) 8:38 AM
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: 11028ab62899 Merge tag 'probes-fixes-v7.2-rc5' of git://gi..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1209649e580000
kernel config: https://syzkaller.appspot.com/x/.config?x=f221a1b5d497ed15
dashboard link: https://syzkaller.appspot.com/bug?extid=f4d51dee46e7742cc3a1
compiler: gcc (Debian 14.2.0-19) 14.2.0, GNU ld (GNU Binutils for Debian) 2.44
userspace arch: i386
CC: [andrew...@lunn.ch da...@davemloft.net edum...@google.com ku...@kernel.org linux-...@vger.kernel.org net...@vger.kernel.org pab...@redhat.com]

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-11028ab6.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/50d1387eb51d/vmlinux-11028ab6.xz
kernel image: https://storage.googleapis.com/syzbot-assets/30ffbd0f8cd4/bzImage-11028ab6.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+f4d51d...@syzkaller.appspotmail.com

------------[ 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:
<TASK>
__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
</TASK>
----------------
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


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup
Reply all
Reply to author
Forward
0 new messages