syzbot


KASAN: use-after-free Read in debugfs_remove

Status: closed as invalid on 2018/04/10 15:18
Reported-by: syzbot+9b16d7f25a0adb35345b@syzkaller.appspotmail.com
First crash: 1602d, last: 1602d
similar bugs (4):
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KASAN: use-after-free Read in debugfs_remove (2) 1 1581d 1579d 6/23 fixed on 2018/05/17 10:02
linux-4.19 KASAN: use-after-free Read in debugfs_remove C done 15 656d 1153d 1/1 fixed on 2020/12/01 11:25
upstream KASAN: use-after-free Read in debugfs_remove (3) C done error 88 943d 1409d 0/23 closed as dup on 2020/06/28 17:08
linux-4.14 KASAN: use-after-free Read in debugfs_remove C inconclusive 14 665d 1220d 0/1 upstream: reported C repro on 2019/04/17 06:08

Sample crash report:
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
==================================================================

Crashes (1):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2018/03/31 00:51 upstream 9dd2326890d8 8fbce0e4 .config log report