WARNING: refcount bug in kobject_get

14 views
Skip to first unread message

syzbot

unread,
Apr 14, 2019, 6:44:05 AM4/14/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 1ec8f1f0 Linux 4.14.111
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=119abf4b200000
kernel config: https://syzkaller.appspot.com/x/.config?x=fdadf290ea9fc6f9
dashboard link: https://syzkaller.appspot.com/bug?extid=122b2c22c75de10ba756
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

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

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

kobject: '(null)' (ffff88809b446ae8): calling ktype release
refcount_t: increment on 0; use-after-free.
kobject: 'event4' (ffff88808fcc6178): kobject_uevent_env
------------[ cut here ]------------
kobject: 'event4' (ffff88808fcc6178): fill_kobj_path: path
= '/devices/virtual/input/input234/event4'
WARNING: CPU: 1 PID: 20150 at lib/refcount.c:153 refcount_inc
lib/refcount.c:153 [inline]
WARNING: CPU: 1 PID: 20150 at lib/refcount.c:153
refcount_inc.cold+0x18/0x1f lib/refcount.c:151
Kernel panic - not syncing: panic_on_warn set ...

CPU: 1 PID: 20150 Comm: syz-executor.5 Not tainted 4.14.111 #1
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x138/0x19c lib/dump_stack.c:53
panic+0x1f2/0x438 kernel/panic.c:182
__warn.cold+0x2f/0x34 kernel/panic.c:546
report_bug+0x216/0x254 lib/bug.c:186
fixup_bug arch/x86/kernel/traps.c:177 [inline]
fixup_bug arch/x86/kernel/traps.c:172 [inline]
do_error_trap+0x1bb/0x310 arch/x86/kernel/traps.c:295
do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:314
invalid_op+0x1b/0x40 arch/x86/entry/entry_64.S:944
RIP: 0010:refcount_inc lib/refcount.c:153 [inline]
RIP: 0010:refcount_inc.cold+0x18/0x1f lib/refcount.c:151
RSP: 0018:ffff88808cccf980 EFLAGS: 00010286
RAX: 000000000000002b RBX: 1ffff11011999f3d RCX: 0000000000000000
RDX: 0000000000029f76 RSI: ffffffff814b2a55 RDI: ffffed1011999f26
RBP: ffff88808cccf988 R08: 000000000000002b R09: ffff88807b7e0d60
R10: 0000000000000000 R11: 0000000000000000 R12: ffff88809b446b20
R13: 0000000000000000 R14: ffff88807bfb9840 R15: ffff88808a84f9b8
kref_get include/linux/kref.h:47 [inline]
kobject_get+0x5b/0x70 lib/kobject.c:596
cdev_get+0x54/0xa0 fs/char_dev.c:358
chrdev_open+0x9b/0x590 fs/char_dev.c:403
do_dentry_open+0x73e/0xeb0 fs/open.c:758
vfs_open+0x105/0x230 fs/open.c:872
do_last fs/namei.c:3425 [inline]
path_openat+0x8bd/0x3f70 fs/namei.c:3566
do_filp_open+0x18e/0x250 fs/namei.c:3600
do_sys_open+0x2c5/0x430 fs/open.c:1065
SYSC_open fs/open.c:1083 [inline]
SyS_open+0x2d/0x40 fs/open.c:1078
do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x412bc1
RSP: 002b:00007f4d8473c7a0 EFLAGS: 00000293 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 6666666666666667 RCX: 0000000000412bc1
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007f4d8473c850
RBP: 000000000073bf00 R08: 000000000000000f R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000293 R12: 00007f4d8473d6d4
R13: 00000000004c7975 R14: 00000000004dda00 R15: 00000000ffffffff
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
This bug 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 bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Apr 14, 2019, 8:02:07 AM4/14/19
to syzkaller...@googlegroups.com
syzbot has found a reproducer for the following crash on:

HEAD commit: 1ec8f1f0 Linux 4.14.111
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15389023200000
kernel config: https://syzkaller.appspot.com/x/.config?x=fdadf290ea9fc6f9
dashboard link: https://syzkaller.appspot.com/bug?extid=122b2c22c75de10ba756
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=11b85efd200000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11fba6d3200000

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

input: syz0 as /devices/virtual/input/input1695
input: syz0 as /devices/virtual/input/input1696
input: syz0 as /devices/virtual/input/input1697
refcount_t: increment on 0; use-after-free.
------------[ cut here ]------------
WARNING: CPU: 1 PID: 10546 at lib/refcount.c:153 refcount_inc
lib/refcount.c:153 [inline]
WARNING: CPU: 1 PID: 10546 at lib/refcount.c:153
refcount_inc.cold+0x18/0x1f lib/refcount.c:151
Kernel panic - not syncing: panic_on_warn set ...

CPU: 1 PID: 10546 Comm: syz-executor008 Not tainted 4.14.111 #1
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x138/0x19c lib/dump_stack.c:53
panic+0x1f2/0x438 kernel/panic.c:182
__warn.cold+0x2f/0x34 kernel/panic.c:546
report_bug+0x216/0x254 lib/bug.c:186
fixup_bug arch/x86/kernel/traps.c:177 [inline]
fixup_bug arch/x86/kernel/traps.c:172 [inline]
do_error_trap+0x1bb/0x310 arch/x86/kernel/traps.c:295
do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:314
invalid_op+0x1b/0x40 arch/x86/entry/entry_64.S:944
RIP: 0010:refcount_inc lib/refcount.c:153 [inline]
RIP: 0010:refcount_inc.cold+0x18/0x1f lib/refcount.c:151
RSP: 0018:ffff888099d9f980 EFLAGS: 00010286
RAX: 000000000000002b RBX: 1ffff110133b3f3d RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffff8880a7d46dc0 RDI: ffffed10133b3f26
RBP: ffff888099d9f988 R08: 000000000000002b R09: ffff8880a7d46de0
R10: 0000000000000000 R11: 0000000000000000 R12: ffff88808332d320
R13: 0000000000000000 R14: ffff88809df20780 R15: ffff8880969e4ee8
kref_get include/linux/kref.h:47 [inline]
kobject_get+0x5b/0x70 lib/kobject.c:596
cdev_get+0x54/0xa0 fs/char_dev.c:358
chrdev_open+0x9b/0x590 fs/char_dev.c:403
do_dentry_open+0x73e/0xeb0 fs/open.c:758
vfs_open+0x105/0x230 fs/open.c:872
do_last fs/namei.c:3425 [inline]
path_openat+0x8bd/0x3f70 fs/namei.c:3566
do_filp_open+0x18e/0x250 fs/namei.c:3600
do_sys_open+0x2c5/0x430 fs/open.c:1065
SYSC_open fs/open.c:1083 [inline]
SyS_open+0x2d/0x40 fs/open.c:1078
do_syscall_64+0x1eb/0x630 arch/x86/entry/common.c:289
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x402ec0
RSP: 002b:00007ffc806bb038 EFLAGS: 00000246 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 000000000000000a RCX: 0000000000402ec0
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007ffc806bb050
RBP: 0000000000000000 R08: 000000000000000f R09: 00000000000003e8
R10: 00000000000003e8 R11: 0000000000000246 R12: 0000000000000121
R13: 00000000004aacf0 R14: 0000000000000000 R15: 0000000000000000

syzbot

unread,
Apr 18, 2019, 12:23:06 PM4/18/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 4b0e041c Linux 4.19.35
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=11ae8857200000
kernel config: https://syzkaller.appspot.com/x/.config?x=bb1bcac868b1655e
dashboard link: https://syzkaller.appspot.com/bug?extid=c89d96cb5cb7bfe23d4b
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=112c2ffd200000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12a50bdd200000

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

input: syz1 as /devices/virtual/input/input530
input: syz1 as /devices/virtual/input/input531
input: syz1 as /devices/virtual/input/input532
------------[ cut here ]------------
refcount_t: increment on 0; use-after-free.
WARNING: CPU: 0 PID: 10447 at lib/refcount.c:153 refcount_inc_checked
lib/refcount.c:153 [inline]
WARNING: CPU: 0 PID: 10447 at lib/refcount.c:153
refcount_inc_checked+0x61/0x70 lib/refcount.c:151
Kernel panic - not syncing: panic_on_warn set ...

CPU: 0 PID: 10447 Comm: syz-executor033 Not tainted 4.19.35 #3
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x172/0x1f0 lib/dump_stack.c:113
panic+0x263/0x51d kernel/panic.c:185
__warn.cold+0x20/0x54 kernel/panic.c:540
report_bug+0x263/0x2b0 lib/bug.c:186
fixup_bug arch/x86/kernel/traps.c:178 [inline]
fixup_bug arch/x86/kernel/traps.c:173 [inline]
do_error_trap+0x204/0x360 arch/x86/kernel/traps.c:296
do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:316
invalid_op+0x14/0x20 arch/x86/entry/entry_64.S:997
RIP: 0010:refcount_inc_checked lib/refcount.c:153 [inline]
RIP: 0010:refcount_inc_checked+0x61/0x70 lib/refcount.c:151
Code: 1d c9 5d 12 06 31 ff 89 de e8 ab a6 47 fe 84 db 75 dd e8 62 a5 47 fe
48 c7 c7 c0 82 81 87 c6 05 a9 5d 12 06 01 e8 7d 81 1b fe <0f> 0b eb c1 90
66 2e 0f 1f 84 00 00 00 00 00 55 48 89 e5 41 57 41
RSP: 0018:ffff8880925ff8b8 EFLAGS: 00010282
RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff8155cf26 RDI: ffffed10124bff09
RBP: ffff8880925ff8c8 R08: ffff88808e3a42c0 R09: ffff88808e3a4b60
R10: 0000000000000000 R11: 0000000000000000 R12: ffff8880a01eca28
R13: 0000000000000000 R14: ffff888099874080 R15: ffff8880925b8f10
kref_get include/linux/kref.h:47 [inline]
kobject_get+0x66/0xc0 lib/kobject.c:613
cdev_get+0x60/0xb0 fs/char_dev.c:358
chrdev_open+0xb0/0x6b0 fs/char_dev.c:403
do_dentry_open+0x4c6/0x1200 fs/open.c:777
vfs_open+0xa0/0xd0 fs/open.c:886
do_last fs/namei.c:3418 [inline]
path_openat+0x10d7/0x4690 fs/namei.c:3534
do_filp_open+0x1a1/0x280 fs/namei.c:3564
do_sys_open+0x3fe/0x550 fs/open.c:1069
__do_sys_open fs/open.c:1087 [inline]
__se_sys_open fs/open.c:1082 [inline]
__x64_sys_open+0x7e/0xc0 fs/open.c:1082
do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x405831
Code: 75 14 b8 02 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 a4 18 00 00 c3 48
83 ec 08 e8 0a fc ff ff 48 89 04 24 b8 02 00 00 00 0f 05 <48> 8b 3c 24 48
89 c2 e8 53 fc ff ff 48 89 d0 48 83 c4 08 48 3d 01
RSP: 002b:00007f34dc89c960 EFLAGS: 00000293 ORIG_RAX: 0000000000000002
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000405831
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007f34dc89c970
RBP: 6666666666666667 R08: 000000000000000f R09: 00007f34dc89d700
R10: 00007f34dc89d9d0 R11: 0000000000000293 R12: 00000000006dbc3c
R13: 0000000000000000 R14: 0000000000000000 R15: 00000000317a7973
Kernel Offset: disabled
Rebooting in 86400 seconds..


---
This bug 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 bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
syzbot can test patches for this bug, for details see:
https://goo.gl/tpsmEJ#testing-patches

syzbot

unread,
Jan 3, 2020, 12:23:02 AM1/3/20
to syzkaller...@googlegroups.com
syzbot suspects this bug was fixed by commit:

commit 227db8e4c34674124ee6e4a9d534f3a0cc22304c
Author: Tuong Lien <tuong....@dektech.com.au>
Date: Wed Oct 2 11:49:43 2019 +0000

tipc: fix unlimited bundling of small messages

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=15381751e00000
start commit: ff33472c Linux 4.14.134
git tree: linux-4.14.y
kernel config: https://syzkaller.appspot.com/x/.config?x=3559c2b3fb5dd4b2
dashboard link: https://syzkaller.appspot.com/bug?extid=122b2c22c75de10ba756
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=13979594600000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=10d2eb3fa00000

If the result looks correct, please mark the bug fixed by replying with:

#syz fix: tipc: fix unlimited bundling of small messages

For information about bisection process see: https://goo.gl/tpsmEJ#bisection

syzbot

unread,
Jan 3, 2020, 4:18:01 AM1/3/20
to syzkaller...@googlegroups.com
syzbot suspects this bug was fixed by commit:

commit e1666bcbae0c5edb6d7a752b31a8f28c59b54546
Author: Muchun Song <smu...@gmail.com>
Date: Sat Jul 27 03:21:22 2019 +0000

driver core: Fix use-after-free and double free on glue directory

bisection log: https://syzkaller.appspot.com/x/bisect.txt?x=11855e49e00000
start commit: aec3002d Linux 4.19.56
git tree: linux-4.19.y
kernel config: https://syzkaller.appspot.com/x/.config?x=48b721ea0070d1cd
dashboard link: https://syzkaller.appspot.com/bug?extid=c89d96cb5cb7bfe23d4b
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=12118105a00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=162c5fc5a00000

If the result looks correct, please mark the bug fixed by replying with:

#syz fix: driver core: Fix use-after-free and double free on glue directory
Reply all
Reply to author
Forward
0 new messages