erofs: unmounted for /dev/loop0 erofs: read_super, device -> /dev/loop5 erofs: options -> erofs: root inode @ nid 36 ================================================================== BUG: KASAN: use-after-free in hlist_bl_add_head_rcu include/linux/rculist_bl.h:109 [inline] BUG: KASAN: use-after-free in __d_rehash+0x217/0x220 fs/dcache.c:2385 Write of size 8 at addr ffff880090858038 by task syz-executor.5/10635 CPU: 1 PID: 10635 Comm: syz-executor.5 Not tainted 4.19.0-rc1-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+0x15a/0x20d lib/dump_stack.c:113 print_address_description.cold.6+0x9/0x244 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold.7+0x242/0x305 mm/kasan/report.c:396 __asan_report_store8_noabort+0x17/0x20 mm/kasan/report.c:438 hlist_bl_add_head_rcu include/linux/rculist_bl.h:109 [inline] __d_rehash+0x217/0x220 fs/dcache.c:2385 d_rehash+0x21/0x30 fs/dcache.c:2399 erofs_read_super drivers/staging/erofs/super.c:411 [inline] erofs_fill_super+0x115a/0x1269 drivers/staging/erofs/super.c:487 mount_bdev+0x26f/0x330 fs/super.c:1158 erofs_mount+0x6a/0x90 drivers/staging/erofs/super.c:500 mount_fs+0x7f/0x2a9 fs/super.c:1261 vfs_kern_mount.part.11+0x58/0x3d0 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2457 [inline] do_mount+0x376/0x2710 fs/namespace.c:2787 ksys_mount+0xb1/0xd0 fs/namespace.c:3003 __do_sys_mount fs/namespace.c:3017 [inline] __se_sys_mount fs/namespace.c:3014 [inline] __x64_sys_mount+0xb9/0x150 fs/namespace.c:3014 do_syscall_64+0xda/0x540 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x7fe409ba9f6a Code: 48 c7 c2 bc ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fe40931dfa8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 00007fe409ba9f6a RDX: 0000000020000080 RSI: 0000000020000100 RDI: 00007fe40931e000 RBP: 00007fe40931e040 R08: 00007fe40931e040 R09: 0000000020000080 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000080 R13: 0000000020000100 R14: 00007fe40931e000 R15: 0000000020000280 Allocated by task 10615: save_stack mm/kasan/kasan.c:448 [inline] set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:553 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:538 kasan_slab_alloc+0x11/0x20 mm/kasan/kasan.c:490 slab_post_alloc_hook mm/slab.h:444 [inline] slab_alloc_node mm/slub.c:2707 [inline] slab_alloc mm/slub.c:2715 [inline] kmem_cache_alloc+0xe8/0x2c0 mm/slub.c:2720 __d_alloc+0x28/0x9d0 fs/dcache.c:1614 d_alloc_anon fs/dcache.c:1718 [inline] d_make_root+0x38/0xa0 fs/dcache.c:1905 erofs_read_super drivers/staging/erofs/super.c:389 [inline] erofs_fill_super+0xfdc/0x1269 drivers/staging/erofs/super.c:487 mount_bdev+0x26f/0x330 fs/super.c:1158 erofs_mount+0x6a/0x90 drivers/staging/erofs/super.c:500 mount_fs+0x7f/0x2a9 fs/super.c:1261 vfs_kern_mount.part.11+0x58/0x3d0 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2457 [inline] do_mount+0x376/0x2710 fs/namespace.c:2787 ksys_mount+0xb1/0xd0 fs/namespace.c:3003 __do_sys_mount fs/namespace.c:3017 [inline] __se_sys_mount fs/namespace.c:3014 [inline] __x64_sys_mount+0xb9/0x150 fs/namespace.c:3014 do_syscall_64+0xda/0x540 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 18: save_stack mm/kasan/kasan.c:448 [inline] set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x167/0x240 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 slab_free_hook mm/slub.c:1372 [inline] slab_free_freelist_hook mm/slub.c:1399 [inline] slab_free mm/slub.c:2954 [inline] kmem_cache_free+0xdd/0x320 mm/slub.c:2970 __d_free+0x17/0x20 fs/dcache.c:257 __rcu_reclaim kernel/rcu/rcu.h:236 [inline] rcu_do_batch kernel/rcu/tree.c:2576 [inline] invoke_rcu_callbacks kernel/rcu/tree.c:2880 [inline] __rcu_process_callbacks kernel/rcu/tree.c:2847 [inline] rcu_process_callbacks+0x93a/0x19b0 kernel/rcu/tree.c:2864 __do_softirq+0x25f/0x8ed kernel/softirq.c:292 The buggy address belongs to the object at ffff880090858000 which belongs to the cache dentry of size 288 The buggy address is located 56 bytes inside of 288-byte region [ffff880090858000, ffff880090858120) The buggy address belongs to the page: page:ffffea0002421600 count:1 mapcount:0 mapping:ffff88013be25800 index:0x0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 dead000000000100 dead000000000200 ffff88013be25800 raw: 0000000000000000 0000000000170017 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page allocated via order 1, migratetype Reclaimable, gfp_mask 0x152d0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_RECLAIMABLE) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:1907 [inline] prep_new_page mm/page_alloc.c:1915 [inline] get_page_from_freelist+0x3033/0x4530 mm/page_alloc.c:3346 __alloc_pages_nodemask+0x39e/0x2670 mm/page_alloc.c:4371 alloc_pages_current+0xd6/0x1b0 mm/mempolicy.c:2093 alloc_pages include/linux/gfp.h:509 [inline] alloc_slab_page mm/slub.c:1439 [inline] allocate_slab mm/slub.c:1584 [inline] new_slab+0x4a9/0x850 mm/slub.c:1655 new_slab_objects mm/slub.c:2418 [inline] ___slab_alloc+0x648/0x980 mm/slub.c:2570 __slab_alloc.isra.22+0x78/0xe0 mm/slub.c:2610 slab_alloc_node mm/slub.c:2673 [inline] slab_alloc mm/slub.c:2715 [inline] kmem_cache_alloc+0x250/0x2c0 mm/slub.c:2720 __d_alloc+0x28/0x9d0 fs/dcache.c:1614 d_alloc+0x43/0x250 fs/dcache.c:1698 __lookup_hash+0xa5/0x150 fs/namei.c:1542 filename_create+0x179/0x400 fs/namei.c:3636 user_path_create fs/namei.c:3693 [inline] do_mkdirat+0xae/0x220 fs/namei.c:3832 __do_sys_mkdir fs/namei.c:3856 [inline] __se_sys_mkdir fs/namei.c:3854 [inline] __x64_sys_mkdir+0x57/0x80 fs/namei.c:3854 do_syscall_64+0xda/0x540 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Memory state around the buggy address: ffff880090857f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff880090857f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff880090858000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff880090858080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff880090858100: fb fb fb fb fc fc fc fc fc fc fc fc fb fb fb fb ==================================================================