syzbot


KASAN: use-after-free Read in fuse_kill_sb_anon

Status: closed as dup on 2018/05/04 17:19
Reported-by: syzbot+4bb3ee1dd0bd632f21d7@syzkaller.appspotmail.com
First crash: 1611d, last: 1577d
Duplicate of (1):
Title Repro Cause bisect Fix bisect Count Last Reported
KASAN: use-after-free Read in fuse_kill_sb_blk 4 1596d 1615d

Sample crash report:
RBP: 0000000000000000 R08: 00007f2f811ba820 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000020000000 R14: 0000000000000000 R15: 0000000000000000
==================================================================
XFS (loop1): Invalid superblock magic number
BUG: KASAN: use-after-free in __lock_acquire+0x3888/0x5140 kernel/locking/lockdep.c:3314
Read of size 8 at addr ffff8801b49afe08 by task syz-executor7/27693

CPU: 0 PID: 27693 Comm: syz-executor7 Not tainted 4.17.0+ #89
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+0x1b9/0x294 lib/dump_stack.c:113
 print_address_description+0x6c/0x20b mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:412
 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report.c:433
 __lock_acquire+0x3888/0x5140 kernel/locking/lockdep.c:3314
 lock_acquire+0x1dc/0x520 kernel/locking/lockdep.c:3924
 down_write+0x87/0x120 kernel/locking/rwsem.c:70
 fuse_kill_sb_anon+0x50/0xb0 fs/fuse/inode.c:1200
 deactivate_locked_super+0x97/0x100 fs/super.c:326
 mount_nodev+0xfa/0x110 fs/super.c:1222
 fuse_mount+0x2c/0x40 fs/fuse/inode.c:1192
 mount_fs+0xae/0x328 fs/super.c:1277
 vfs_kern_mount.part.34+0xd4/0x4d0 fs/namespace.c:1037
 vfs_kern_mount fs/namespace.c:1027 [inline]
 do_new_mount fs/namespace.c:2518 [inline]
 do_mount+0x564/0x30b0 fs/namespace.c:2848
 ksys_mount+0x12d/0x140 fs/namespace.c:3064
 __do_sys_mount fs/namespace.c:3078 [inline]
 __se_sys_mount fs/namespace.c:3075 [inline]
 __x64_sys_mount+0xbe/0x150 fs/namespace.c:3075
 do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x4559f9
Code: 1d ba fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 0f 83 eb b9 fb ff c3 66 2e 0f 1f 84 00 00 00 00 
RSP: 002b:00007f2f811ba808 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 0000000000000016 RCX: 00000000004559f9
RDX: 00000000004c231c RSI: 0000000020000000 RDI: 00000000004ea1e5
RBP: 0000000000000000 R08: 00007f2f811ba820 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000020000000 R14: 0000000000000000 R15: 0000000000000000

Allocated by task 27693:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 kasan_kmalloc+0xc4/0xe0 mm/kasan/kasan.c:553
 kmem_cache_alloc_trace+0x152/0x780 mm/slab.c:3620
 kmalloc include/linux/slab.h:513 [inline]
 fuse_fill_super+0xc92/0x1e20 fs/fuse/inode.c:1096
 mount_nodev+0x6b/0x110 fs/super.c:1220
 fuse_mount+0x2c/0x40 fs/fuse/inode.c:1192
 mount_fs+0xae/0x328 fs/super.c:1277
 vfs_kern_mount.part.34+0xd4/0x4d0 fs/namespace.c:1037
 vfs_kern_mount fs/namespace.c:1027 [inline]
 do_new_mount fs/namespace.c:2518 [inline]
 do_mount+0x564/0x30b0 fs/namespace.c:2848
 ksys_mount+0x12d/0x140 fs/namespace.c:3064
 __do_sys_mount fs/namespace.c:3078 [inline]
 __se_sys_mount fs/namespace.c:3075 [inline]
 __x64_sys_mount+0xbe/0x150 fs/namespace.c:3075
 do_syscall_64+0x1b1/0x800 arch/x86/entry/common.c:287
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

Freed by task 26:
 save_stack+0x43/0xd0 mm/kasan/kasan.c:448
 set_track mm/kasan/kasan.c:460 [inline]
 __kasan_slab_free+0x11a/0x170 mm/kasan/kasan.c:521
 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528
 __cache_free mm/slab.c:3498 [inline]
 kfree+0xd9/0x260 mm/slab.c:3813
 __rcu_reclaim kernel/rcu/rcu.h:173 [inline]
 rcu_do_batch kernel/rcu/tree.c:2558 [inline]
 invoke_rcu_callbacks kernel/rcu/tree.c:2818 [inline]
 __rcu_process_callbacks kernel/rcu/tree.c:2785 [inline]
 rcu_process_callbacks+0xfc5/0x1760 kernel/rcu/tree.c:2802
 __do_softirq+0x2e0/0xaf5 kernel/softirq.c:284

The buggy address belongs to the object at ffff8801b49afb40
 which belongs to the cache kmalloc-1024 of size 1024
The buggy address is located 712 bytes inside of
 1024-byte region [ffff8801b49afb40, ffff8801b49aff40)
The buggy address belongs to the page:
page:ffffea0006d26b80 count:1 mapcount:0 mapping:ffff8801b49ae040 index:0x0 compound_mapcount: 0
flags: 0x2fffc0000008100(slab|head)
raw: 02fffc0000008100 ffff8801b49ae040 0000000000000000 0000000100000007
raw: ffffea00060d26a0 ffffea0006107920 ffff8801da800ac0 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff8801b49afd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801b49afd80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8801b49afe00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
                      ^
 ffff8801b49afe80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
 ffff8801b49aff00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
==================================================================

Crashes (16):
Manager Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Title
ci-upstream-kasan-gce-root 2018/06/07 16:37 upstream 1c8c5a9d38f6 645e75f8 .config log report
ci-upstream-kasan-gce-root 2018/06/02 20:17 upstream 4277e6b9fd44 2f93b54f .config log report
ci-upstream-kasan-gce-root 2018/05/31 14:47 upstream 88a867653065 2f93b54f .config log report
ci-upstream-kasan-gce-root 2018/05/30 21:37 upstream d60d61f36b8f 2f93b54f .config log report
ci-upstream-kasan-gce-root 2018/05/30 01:53 upstream 3d661e2a2d1c 2f93b54f .config log report
ci-upstream-kasan-gce-root 2018/05/26 13:24 upstream bc2dbc5420e8 f48c20b8 .config log report
ci-upstream-kasan-gce-root 2018/05/24 10:44 upstream bee797529d7c f48c20b8 .config log report
ci-upstream-kasan-gce-root 2018/05/18 09:12 upstream 3acf4e395260 c992b767 .config log report
ci-upstream-kasan-gce-root 2018/05/17 15:03 upstream e6506eb24187 90c54c49 .config log report
ci-upstream-kasan-gce-root 2018/05/17 13:17 upstream e6506eb24187 90c54c49 .config log report
ci-upstream-kasan-gce-root 2018/05/17 06:08 upstream e6506eb24187 a367c1d7 .config log report
ci-upstream-kasan-gce-root 2018/05/16 00:06 upstream eeba2dfa6a0d 68ce85f1 .config log report
ci-upstream-kasan-gce-root 2018/05/13 06:35 upstream 427fbe89261d e726f42b .config log report
ci-upstream-kasan-gce-root 2018/05/12 18:36 upstream f0ab773f5c96 e726f42b .config log report
ci-upstream-kasan-gce-root 2018/05/06 05:53 upstream ee946c36be21 78b251cb .config log report
ci-upstream-kasan-gce-root 2018/05/04 10:57 upstream 150426981426 9ce14f4b .config log report
* Struck through repros no longer work on HEAD.