KASAN: use-after-free Read in debugfs_remove

14 views
Skip to first unread message

syzbot

unread,
Mar 31, 2018, 4:47:10 PM3/31/18
to syzkaller-upst...@googlegroups.com
Hello,

syzbot hit the following crash on upstream commit
9dd2326890d89a5179967c947dab2bab34d7ddee (Fri Mar 30 17:29:47 2018 +0000)
Merge tag 'ceph-for-4.16-rc8' of git://github.com/ceph/ceph-client
syzbot dashboard link:
https://syzkaller.appspot.com/bug?extid=9b16d7f25a0adb35345b

Unfortunately, I don't have any reproducer for this crash yet.
Raw console output:
https://syzkaller.appspot.com/x/log.txt?id=5479997015851008
Kernel config:
https://syzkaller.appspot.com/x/.config?id=-2760467897697295172
compiler: gcc (GCC) 7.1.1 20170620
CC: [gre...@linuxfoundation.org linux-...@vger.kernel.org]

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+9b16d7...@syzkaller.appspotmail.com
It will help syzbot understand when the bug is fixed. See footer for
details.
If you forward the report, please keep this part and the footer.

IPVS: set_ctl: invalid protocol: 255 255.255.255.255:20004 ovf
IPVS: set_ctl: invalid protocol: 255 255.255.255.255:20004 ovf
IPVS: ftp: loaded support on port[0] = 21
==================================================================
BUG: KASAN: use-after-free in debugfs_remove+0x1dc/0x1f0
fs/debugfs/inode.c:685
Read of size 8 at addr ffff8801cb55a8e0 by task syz-executor5/13801

CPU: 0 PID: 13801 Comm: syz-executor5 Not tainted 4.16.0-rc7+ #7
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+0x194/0x24d lib/dump_stack.c:53
print_address_description+0x73/0x250 mm/kasan/report.c:256
kasan_report_error mm/kasan/report.c:354 [inline]
kasan_report+0x23c/0x360 mm/kasan/report.c:412
__asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
debugfs_remove+0x1dc/0x1f0 fs/debugfs/inode.c:685
bdi_debug_unregister mm/backing-dev.c:138 [inline]
bdi_unregister+0x5db/0x890 mm/backing-dev.c:947
release_bdi mm/backing-dev.c:964 [inline]
kref_put include/linux/kref.h:70 [inline]
bdi_put+0x133/0x160 mm/backing-dev.c:973
generic_shutdown_super+0x3be/0x540 fs/super.c:453
kill_anon_super+0x3c/0x50 fs/super.c:991
fuse_kill_sb_anon+0x90/0xb0 fs/fuse/inode.c:1202
deactivate_locked_super+0x88/0xd0 fs/super.c:312
deactivate_super+0x141/0x1b0 fs/super.c:343
cleanup_mnt+0xb2/0x150 fs/namespace.c:1173
__cleanup_mnt+0x16/0x20 fs/namespace.c:1180
task_work_run+0x199/0x270 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:191 [inline]
exit_to_usermode_loop+0x275/0x2f0 arch/x86/entry/common.c:166
prepare_exit_to_usermode arch/x86/entry/common.c:196 [inline]
syscall_return_slowpath arch/x86/entry/common.c:265 [inline]
do_syscall_64+0x6ec/0x940 arch/x86/entry/common.c:292
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x454e79
RSP: 002b:00007f65d98dac68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007f65d98db6d4 RCX: 0000000000454e79
RDX: 0000000000000000 RSI: 0000000000000003 RDI: 0000000020000200
RBP: 000000000072bf58 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00000000ffffffff
R13: 00000000000006a1 R14: 00000000006fbfb8 R15: 0000000000000001

Allocated by task 13759:
save_stack+0x43/0xd0 mm/kasan/kasan.c:447
set_track mm/kasan/kasan.c:459 [inline]
kasan_kmalloc+0xad/0xe0 mm/kasan/kasan.c:552
kasan_slab_alloc+0x12/0x20 mm/kasan/kasan.c:489
slab_post_alloc_hook mm/slab.h:443 [inline]
slab_alloc mm/slab.c:3380 [inline]
kmem_cache_alloc+0x11b/0x760 mm/slab.c:3540
__d_alloc+0xc1/0xbd0 fs/dcache.c:1610
d_alloc+0x8e/0x340 fs/dcache.c:1688
__lookup_hash+0x58/0x190 fs/namei.c:1509
lookup_one_len+0x3a9/0x4c0 fs/namei.c:2477
start_creating+0xa6/0x1b0 fs/debugfs/inode.c:311
debugfs_create_dir+0x23/0x3b0 fs/debugfs/inode.c:508
bdi_debug_register mm/backing-dev.c:121 [inline]
bdi_register_va.part.10+0x290/0x8c0 mm/backing-dev.c:888
bdi_register_va+0x68/0x80 mm/backing-dev.c:897
super_setup_bdi_name+0x136/0x230 fs/super.c:1274
fuse_bdi_init fs/fuse/inode.c:987 [inline]
fuse_fill_super+0xe75/0x1d60 fs/fuse/inode.c:1107
mount_nodev+0x59/0x100 fs/super.c:1165
fuse_mount+0x2c/0x40 fs/fuse/inode.c:1189
mount_fs+0x66/0x2d0 fs/super.c:1222
vfs_kern_mount.part.26+0xc6/0x4a0 fs/namespace.c:1037
vfs_kern_mount fs/namespace.c:2509 [inline]
do_new_mount fs/namespace.c:2512 [inline]
do_mount+0xea4/0x2bb0 fs/namespace.c:2842
SYSC_mount fs/namespace.c:3058 [inline]
SyS_mount+0xab/0x120 fs/namespace.c:3035
do_syscall_64+0x281/0x940 arch/x86/entry/common.c:287
entry_SYSCALL_64_after_hwframe+0x42/0xb7

Freed by task 13765:
save_stack+0x43/0xd0 mm/kasan/kasan.c:447
set_track mm/kasan/kasan.c:459 [inline]
__kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:520
kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:527
__cache_free mm/slab.c:3486 [inline]
kmem_cache_free+0x83/0x2a0 mm/slab.c:3744
__d_free+0x20/0x30 fs/dcache.c:266
__rcu_reclaim kernel/rcu/rcu.h:172 [inline]
rcu_do_batch kernel/rcu/tree.c:2674 [inline]
invoke_rcu_callbacks kernel/rcu/tree.c:2933 [inline]
__rcu_process_callbacks kernel/rcu/tree.c:2900 [inline]
rcu_process_callbacks+0xd6c/0x17f0 kernel/rcu/tree.c:2917
__do_softirq+0x2d7/0xb85 kernel/softirq.c:285

The buggy address belongs to the object at ffff8801cb55a8a0
which belongs to the cache dentry(113:syz5) of size 288
The buggy address is located 64 bytes inside of
288-byte region [ffff8801cb55a8a0, ffff8801cb55a9c0)
The buggy address belongs to the page:
page:ffffea00072d5680 count:1 mapcount:0 mapping:ffff8801cb55a000
index:0xffff8801cb55a5c0
flags: 0x2fffc0000000100(slab)
raw: 02fffc0000000100 ffff8801cb55a000 ffff8801cb55a5c0 0000000100000005
raw: ffffea0005f540a0 ffffea0007256fa0 ffff8801ad546840 ffff880185224a80
page dumped because: kasan: bad access detected
page->mem_cgroup:ffff880185224a80

Memory state around the buggy address:
ffff8801cb55a780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8801cb55a800: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc
> ffff8801cb55a880: fc fc fc fc fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8801cb55a900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8801cb55a980: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================


---
This bug is generated by a dumb bot. It may contain errors.
See https://goo.gl/tpsmEJ for details.
Direct all questions to syzk...@googlegroups.com.

syzbot will keep track of this bug report.
If you forgot to add the Reported-by tag, once the fix for this bug is
merged
into any tree, please reply to this email with:
#syz fix: exact-commit-title
To mark this as a duplicate of another syzbot report, please reply with:
#syz dup: exact-subject-of-another-report
If it's a one-off invalid bug report, please reply with:
#syz invalid
Note: if the crash happens again, it will cause creation of a new bug
report.
Note: all commands must start from beginning of the line in the email body.
To upstream this report, please reply with:
#syz upstream

syzbot

unread,
Mar 31, 2018, 4:47:12 PM3/31/18
to syzkaller-upst...@googlegroups.com

Dmitry Vyukov

unread,
Apr 10, 2018, 11:18:34 AM4/10/18
to syzbot, 'Dmitry Vyukov' via syzkaller-upstream-moderation
Let's assume this is fixed by "vlan: Fix vlan insertion for packets
without ethernet header", which caused a splash of random crashes.

#syz invalid
> --
> You received this message because you are subscribed to the Google Groups
> "syzkaller-upstream-moderation" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to syzkaller-upstream-m...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/syzkaller-upstream-moderation/94eb2c0b8e08ecd22d0568bb75ce%40google.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages