general protection fault in kernfs_add_one

5 visningar
Hoppa till det första olästa meddelandet

syzbot

oläst,
24 maj 2019 18:57:062019-05-24
till syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: bbcb3c09 Linux 4.14.121
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=16d19d30a00000
kernel config: https://syzkaller.appspot.com/x/.config?x=2a2cb26ecd414213
dashboard link: https://syzkaller.appspot.com/bug?extid=23e2b75b45e0821f1115
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+23e2b7...@syzkaller.appspotmail.com

protocol 88fb is buggy, dev hsr_slave_0
protocol 88fb is buggy, dev hsr_slave_1
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
Modules linked in:
CPU: 1 PID: 26461 Comm: syz-executor.2 Not tainted 4.14.121 #15
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
task: ffff888093da8440 task.stack: ffff888097938000
RIP: 0010:kernfs_add_one+0x2cb/0x3a0 fs/kernfs/dir.c:794
RSP: 0018:ffff88809793f468 EFLAGS: 00010202
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: ffffc90007e65000
RDX: 0000000000000001 RSI: ffffffff81a9c8c3 RDI: 0000000000000008
RBP: ffff88809793f4a0 R08: fffffbfff12348d8 R09: ffff888093da8440
R10: dffffc0000000000 R11: ffff888093da8440 R12: ffff88806141b540
R13: ffff88806141b540 R14: 0000000000000000 R15: ffff88806141b568
FS: 00007fe840e7c700(0000) GS:ffff8880aef00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000000008 CR3: 000000009a7ac000 CR4: 00000000001426e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
kernfs_create_dir_ns+0xea/0x140 fs/kernfs/dir.c:1008
sysfs_create_dir_ns+0xbe/0x1d0 fs/sysfs/dir.c:55
create_dir lib/kobject.c:71 [inline]
kobject_add_internal.part.0.cold+0x114/0x5ae lib/kobject.c:229
kobject_add_internal lib/kobject.c:205 [inline]
kobject_add_varg lib/kobject.c:364 [inline]
kobject_add+0x11f/0x180 lib/kobject.c:409
device_add+0x383/0x1490 drivers/base/core.c:1809
hci_register_dev+0x2d9/0x810 net/bluetooth/hci_core.c:3118
__vhci_create_device+0x2a6/0x560 drivers/bluetooth/hci_vhci.c:139
vhci_create_device drivers/bluetooth/hci_vhci.c:163 [inline]
vhci_get_user drivers/bluetooth/hci_vhci.c:219 [inline]
vhci_write+0x2a1/0x437 drivers/bluetooth/hci_vhci.c:299
call_write_iter include/linux/fs.h:1774 [inline]
new_sync_write fs/read_write.c:469 [inline]
__vfs_write+0x4a7/0x6b0 fs/read_write.c:482
__kernel_write+0xfc/0x370 fs/read_write.c:501
write_pipe_buf+0x148/0x1c0 fs/splice.c:797
splice_from_pipe_feed fs/splice.c:502 [inline]
__splice_from_pipe+0x348/0x780 fs/splice.c:626
splice_from_pipe+0xf0/0x150 fs/splice.c:661
default_file_splice_write+0x3c/0x80 fs/splice.c:809
do_splice_from fs/splice.c:851 [inline]
direct_splice_actor+0x123/0x190 fs/splice.c:1018
splice_direct_to_actor+0x29e/0x7b0 fs/splice.c:973
do_splice_direct+0x18d/0x230 fs/splice.c:1061
do_sendfile+0x4db/0xbd0 fs/read_write.c:1440
SYSC_sendfile64 fs/read_write.c:1495 [inline]
SyS_sendfile64+0x9d/0x110 fs/read_write.c:1487
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x459279
RSP: 002b:00007fe840e7bc78 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 0000000000459279
RDX: 0000000020000140 RSI: 0000000000000005 RDI: 0000000000000003
RBP: 000000000075c100 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000002 R11: 0000000000000246 R12: 00007fe840e7c6d4
R13: 00000000004c65f3 R14: 00000000004db268 R15: 00000000ffffffff
Code: 70 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 9a 00 00 00 48 b8 00 00 00
00 00 fc ff df 48 8b 5b 70 48 8d 7b 08 48 89 fa 48 c1 ea 03 <0f> b6 04 02
84 c0 74 04 3c 03 7e 6e f6 43 08 01 0f 85 09 fe ff
RIP: kernfs_add_one+0x2cb/0x3a0 fs/kernfs/dir.c:794 RSP: ffff88809793f468
kobject: 'loop3' (ffff8880a49fc960): kobject_uevent_env
kobject: 'loop3' (ffff8880a49fc960): fill_kobj_path: path
= '/devices/virtual/block/loop3'
---[ end trace bd01e1bd02fa1b0c ]---


---
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

oläst,
5 juli 2019 06:44:082019-07-05
till syzkaller...@googlegroups.com
syzbot has found a reproducer for the following crash on:

HEAD commit: e3c1b273 Linux 4.14.132
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=15c0a967a00000
kernel config: https://syzkaller.appspot.com/x/.config?x=a9ac034723e7e02b
dashboard link: https://syzkaller.appspot.com/bug?extid=23e2b75b45e0821f1115
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=169017fba00000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=134fba63a00000

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

kobject_add_internal failed for hci2 (error: -2 parent: bluetooth)
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
Bluetooth: Can't register HCI device
kobject: 'hci1' (ffff8880943715e8): kobject_cleanup, parent (null)
general protection fault: 0000 [#1] PREEMPT SMP KASAN
Modules linked in:
kobject: 'bluetooth' (ffff888096aeb280): kobject_add_internal:
parent: 'virtual', set: '(null)'
CPU: 0 PID: 9146 Comm: syz-executor259 Not tainted 4.14.132 #26
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
task: ffff88808fe8e400 task.stack: ffff8880962d8000
RIP: 0010:kernfs_add_one+0x2cb/0x3a0 fs/kernfs/dir.c:794
RSP: 0018:ffff8880962df980 EFLAGS: 00010202
kobject: 'hci2' (ffff88809085d5a8): kobject_add_internal:
parent: 'bluetooth', set: 'devices'
RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000003
RDX: 0000000000000001 RSI: 0000000000000002 RDI: 0000000000000008
RBP: ffff8880962df9b8 R08: fffffbfff12348d8 R09: ffff88808fe8e400
R10: dffffc0000000000 R11: ffff88808fe8e400 R12: ffff888094ca70e0
R13: ffff888094ca70e0 R14: 0000000000000000 R15: ffff888094ca7108
FS: 0000000000d22880(0000) GS:ffff8880aee00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000004bf748 CR3: 000000009e26b000 CR4: 00000000001406f0
Call Trace:
kernfs_create_dir_ns+0xea/0x140 fs/kernfs/dir.c:1008
sysfs_create_dir_ns+0xbe/0x1d0 fs/sysfs/dir.c:55
create_dir lib/kobject.c:71 [inline]
kobject_add_internal.part.0.cold+0x114/0x5ae lib/kobject.c:229
kobject: 'hci5' (ffff88808a15e1a8): kobject_add_internal:
parent: 'bluetooth', set: 'devices'
kobject_add_internal lib/kobject.c:205 [inline]
kobject_add_varg lib/kobject.c:364 [inline]
kobject_add+0x11f/0x180 lib/kobject.c:409
device_add+0x383/0x1490 drivers/base/core.c:1809
kobject: 'hci1' (ffff8880943715e8): calling ktype release
hci_register_dev+0x2d9/0x810 net/bluetooth/hci_core.c:3118
kobject: 'hci1': free name
__vhci_create_device+0x2a6/0x560 drivers/bluetooth/hci_vhci.c:139
kobject: 'hci5' (ffff88808a15e1a8): kobject_uevent_env
vhci_create_device drivers/bluetooth/hci_vhci.c:163 [inline]
vhci_get_user drivers/bluetooth/hci_vhci.c:219 [inline]
vhci_write+0x2a1/0x437 drivers/bluetooth/hci_vhci.c:299
call_write_iter include/linux/fs.h:1777 [inline]
new_sync_write fs/read_write.c:469 [inline]
__vfs_write+0x4a7/0x6b0 fs/read_write.c:482
kobject_add_internal failed for hci2 (error: -2 parent: bluetooth)
vfs_write+0x198/0x500 fs/read_write.c:544
SYSC_write fs/read_write.c:590 [inline]
SyS_write+0xfd/0x230 fs/read_write.c:582
kobject: 'hci5' (ffff88808a15e1a8): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci5'
do_syscall_64+0x1e8/0x640 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x441279
RSP: 002b:00007ffe97d1d358 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 0000000000441279
RDX: 0000000000000002 RSI: 0000000020000000 RDI: 0000000000000003
RBP: 000000000007787d R08: 00000000004002c8 R09: 00000000004002c8
R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000401ff0
R13: 0000000000402080 R14: 0000000000000000 R15: 0000000000000000
Code:
kobject: 'rfkill2014' (ffff88808a537668): kobject_add_internal:
parent: 'hci5', set: 'devices'
70 48 89 fa 48 c1 ea 03 80 3c 02 00 0f 85 9a 00 00 00 48 b8 00 00 00 00 00
fc ff df 48 8b 5b 70 48 8d 7b 08 48 89
Bluetooth: Can't register HCI device
fa 48 c1 ea 03 <0f> b6 04 02 84 c0 74 04 3c 03 7e 6e f6 43 08 01 0f 85 09
fe ff
RIP: kernfs_add_one+0x2cb/0x3a0 fs/kernfs/dir.c:794 RSP: ffff8880962df980
kobject: 'hci1' (ffff88808ab49ea8): kobject_add_internal:
parent: 'bluetooth', set: 'devices'
kobject: 'hci2' (ffff88808ca66128): kobject_add_internal:
parent: 'bluetooth', set: 'devices'
kobject: 'hci4' (ffff88808a48de28): kobject_add_internal:
parent: 'bluetooth', set: 'devices'
kobject: 'rfkill2014' (ffff88808a537668): kobject_uevent_env
kobject: 'hci4' (ffff88808a48de28): kobject_uevent_env
kobject: 'hci2' (ffff88808ca66128): kobject_uevent_env
kobject: 'hci1' (ffff88808ab49ea8): kobject_uevent_env
kobject: 'hci2' (ffff88809085d5a8): kobject_cleanup, parent (null)
kobject: 'hci4' (ffff88808a48de28): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci4'
kobject: 'hci2' (ffff88809085d5a8): calling ktype release
kobject: 'hci1' (ffff88808ab49ea8): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci1'
kobject: 'hci2' (ffff88808ca66128): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci2'
kobject: 'rfkill2014' (ffff88808a537668): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci5/rfkill2014'
kobject: 'hci2': free name
kobject: 'rfkill2015' (ffff8880a1916a28): kobject_add_internal:
parent: 'hci4', set: 'devices'
kobject: 'hci6' (ffff88808a7ae028): kobject_add_internal:
parent: 'bluetooth', set: 'devices'
kobject: 'rfkill2014' (ffff88808a537668): kobject_uevent_env
kobject: 'hci6' (ffff88808a7ae028): kobject_uevent_env
kobject: 'rfkill2014' (ffff88808a537668): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci5/rfkill2014'
kobject: 'hci6' (ffff88808a7ae028): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci6'
kobject: 'rfkill2015' (ffff8880a1916a28): kobject_uevent_env
kobject: 'rfkill2015' (ffff8880a1916a28): fill_kobj_path: path
= '/devices/virtual/bluetooth/hci4/rfkill2015'
---[ end trace b570cdd897ff8512 ]---
kobject: 'rfkill2016' (ffff88808b1bc1a8): kobject_add_internal:
parent: 'hci1', set: 'devices'
kobject: 'rfkill2015' (ffff8880a1916a28): kobject_uevent_env

syzbot

oläst,
3 dec. 2019 00:09:022019-12-03
till syzkaller...@googlegroups.com
syzbot suspects this bug was fixed by commit:

commit 5432923a6b208b253d95d95cee72d0508c803421
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=11e37446e00000
start commit: e3c1b273 Linux 4.14.132
git tree: linux-4.14.y
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

For information about bisection process see: https://goo.gl/tpsmEJ#bisection
Svara alla
Svara författaren
Vidarebefordra
0 nya meddelanden