KASAN: use-after-free Write in unhash_mnt

8 views
Skip to first unread message

syzbot

unread,
Jun 8, 2020, 12:55:19 AM6/8/20
to syzkaller-upst...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: d6f9469a Merge tag 'erofs-for-5.8-rc1' of git://git.kernel..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1752307a100000
kernel config: https://syzkaller.appspot.com/x/.config?x=b46ebd806238a886
dashboard link: https://syzkaller.appspot.com/bug?extid=bc051007d6d4c8b92868
compiler: gcc (GCC) 9.0.0 20181231 (experimental)
CC: [linux-...@vger.kernel.org linux-...@vger.kernel.org vi...@zeniv.linux.org.uk]

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+bc0510...@syzkaller.appspotmail.com

==================================================================
BUG: KASAN: use-after-free in __write_once_size include/linux/compiler.h:279 [inline]
BUG: KASAN: use-after-free in __hlist_del include/linux/list.h:811 [inline]
BUG: KASAN: use-after-free in hlist_del_init_rcu include/linux/rculist.h:185 [inline]
BUG: KASAN: use-after-free in unhash_mnt+0x3a6/0x420 fs/namespace.c:829
Write of size 8 at addr ffff8880001101c0 by task syz-executor.2/7009

CPU: 0 PID: 7009 Comm: syz-executor.2 Not tainted 5.7.0-syzkaller #0
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+0x188/0x20d lib/dump_stack.c:118
print_address_description.constprop.0.cold+0xd3/0x413 mm/kasan/report.c:383
__kasan_report mm/kasan/report.c:513 [inline]
kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530
__write_once_size include/linux/compiler.h:279 [inline]
__hlist_del include/linux/list.h:811 [inline]
hlist_del_init_rcu include/linux/rculist.h:185 [inline]
unhash_mnt+0x3a6/0x420 fs/namespace.c:829
umount_mnt fs/namespace.c:841 [inline]
__detach_mounts+0xd7/0x290 fs/namespace.c:1680
detach_mounts fs/mount.h:118 [inline]
vfs_rmdir fs/namei.c:3697 [inline]
vfs_rmdir+0x346/0x500 fs/namei.c:3669
do_rmdir+0x371/0x3e0 fs/namei.c:3752
do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295
entry_SYSCALL_64_after_hwframe+0x49/0xb3
RIP: 0033:0x45c837
Code: 00 66 90 b8 57 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 2d b9 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 b8 54 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 0d b9 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007ffc19e22108 EFLAGS: 00000207 ORIG_RAX: 0000000000000054
RAX: ffffffffffffffda RBX: 0000000000000065 RCX: 000000000045c837
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00007ffc19e232a0
RBP: 0000000000001993 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000000005 R11: 0000000000000207 R12: 00007ffc19e232a0
R13: 0000000001da79c0 R14: 0000000000000000 R15: 00007ffc19e25420

Allocated by task 27214:
save_stack+0x1b/0x40 mm/kasan/common.c:48
set_track mm/kasan/common.c:56 [inline]
__kasan_kmalloc mm/kasan/common.c:494 [inline]
__kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:467
slab_post_alloc_hook mm/slab.h:586 [inline]
slab_alloc mm/slab.c:3320 [inline]
kmem_cache_alloc+0x11b/0x740 mm/slab.c:3484
kmem_cache_zalloc include/linux/slab.h:659 [inline]
alloc_vfsmnt+0x23/0x680 fs/namespace.c:177
clone_mnt+0x6c/0xf50 fs/namespace.c:1042
copy_tree+0xfb/0x920 fs/namespace.c:1813
propagate_one fs/pnode.c:261 [inline]
propagate_one+0x40e/0x760 fs/pnode.c:225
propagate_mnt+0xfd/0x330 fs/pnode.c:308
attach_recursive_mnt+0x83f/0xd30 fs/namespace.c:2124
graft_tree+0x199/0x220 fs/namespace.c:2232
do_loopback fs/namespace.c:2360 [inline]
do_mount+0x15a3/0x1b40 fs/namespace.c:3188
__do_sys_mount fs/namespace.c:3404 [inline]
__se_sys_mount fs/namespace.c:3381 [inline]
__x64_sys_mount+0x18f/0x230 fs/namespace.c:3381
do_syscall_64+0xf6/0x7d0 arch/x86/entry/common.c:295
entry_SYSCALL_64_after_hwframe+0x49/0xb3

Freed by task 9:
save_stack+0x1b/0x40 mm/kasan/common.c:48
set_track mm/kasan/common.c:56 [inline]
kasan_set_free_info mm/kasan/common.c:316 [inline]
__kasan_slab_free+0xf7/0x140 mm/kasan/common.c:455
__cache_free mm/slab.c:3426 [inline]
kmem_cache_free+0x7f/0x320 mm/slab.c:3694
rcu_do_batch kernel/rcu/tree.c:2396 [inline]
rcu_core+0x59f/0x1370 kernel/rcu/tree.c:2623
__do_softirq+0x26c/0x9f7 kernel/softirq.c:292

The buggy address belongs to the object at ffff8880001101c0
which belongs to the cache mnt_cache of size 312
The buggy address is located 0 bytes inside of
312-byte region [ffff8880001101c0, ffff8880001102f8)
The buggy address belongs to the page:
page:ffffea0000004400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x7ffe0000000200(slab)
raw: 007ffe0000000200 ffffea000136c888 ffffea00013d88c8 ffff88821bc50c40
raw: 0000000000000000 ffff888000110040 000000010000000a 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff888000110080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888000110100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc
>ffff888000110180: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
^
ffff888000110200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888000110280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc
==================================================================


---
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,
Sep 2, 2020, 12:47:11 AM9/2/20
to syzkaller-upst...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.
Reply all
Reply to author
Forward
0 new messages