REISERFS (device loop0): checking transaction log (loop0) REISERFS (device loop0): Using r5 hash to sort names REISERFS (device loop0): using 3.5.x disk format ================================================================== BUG: KASAN: use-after-free in bin_search_in_dir_item fs/reiserfs/namei.c:40 [inline] BUG: KASAN: use-after-free in search_by_entry_key+0x81f/0x960 fs/reiserfs/namei.c:165 Read of size 4 at addr ffff888088635014 by task syz-executor.0/1322 CPU: 1 PID: 1322 Comm: syz-executor.0 Not tainted 5.19.0-rc1-syzkaller-00263-g1c27f1fc1549 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 bin_search_in_dir_item fs/reiserfs/namei.c:40 [inline] search_by_entry_key+0x81f/0x960 fs/reiserfs/namei.c:165 reiserfs_find_entry.part.0+0x139/0xdf0 fs/reiserfs/namei.c:322 reiserfs_find_entry fs/reiserfs/namei.c:368 [inline] reiserfs_lookup+0x24a/0x490 fs/reiserfs/namei.c:368 __lookup_slow+0x24c/0x480 fs/namei.c:1701 lookup_one_len+0x16a/0x1a0 fs/namei.c:2730 reiserfs_lookup_privroot+0x92/0x280 fs/reiserfs/xattr.c:980 reiserfs_fill_super+0x21bb/0x2fb0 fs/reiserfs/super.c:2176 mount_bdev+0x34d/0x410 fs/super.c:1367 legacy_get_tree+0x105/0x220 fs/fs_context.c:610 vfs_get_tree+0x89/0x2f0 fs/super.c:1497 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x1320/0x1fa0 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7ff7eb68a63a Code: 48 c7 c2 b8 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ff7ec710f88 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000040 RCX: 00007ff7eb68a63a RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007ff7ec710fe0 RBP: 00007ff7ec711020 R08: 00007ff7ec711020 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000020000000 R13: 0000000020000100 R14: 00007ff7ec710fe0 R15: 0000000020000580 The buggy address belongs to the physical page: page:ffffea0002218d40 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x88635 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea0000bf04c8 ffffea00021600c8 0000000000000000 raw: 0000000000000001 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x148c48(GFP_NOFS|__GFP_NOFAIL|__GFP_COMP|__GFP_HARDWALL|__GFP_MOVABLE), pid 1310, tgid 1304 (syz-executor.4), ts 2545197301701, free_ts 2545418562909 prep_new_page mm/page_alloc.c:2456 [inline] get_page_from_freelist+0x1290/0x3b70 mm/page_alloc.c:4198 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5426 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2272 folio_alloc+0x1c/0x70 mm/mempolicy.c:2282 filemap_alloc_folio mm/filemap.c:996 [inline] __filemap_get_folio+0x614/0xf00 mm/filemap.c:1992 pagecache_get_page+0x2e/0x290 mm/folio-compat.c:126 find_or_create_page include/linux/pagemap.h:615 [inline] grow_dev_page fs/buffer.c:946 [inline] grow_buffers fs/buffer.c:1011 [inline] __getblk_slow+0x1fe/0x1080 fs/buffer.c:1038 __getblk_gfp fs/buffer.c:1333 [inline] __bread_gfp+0x26c/0x3b0 fs/buffer.c:1378 sb_bread include/linux/buffer_head.h:302 [inline] read_super_block+0x83/0x930 fs/reiserfs/super.c:1604 reiserfs_fill_super+0x756/0x2fb0 fs/reiserfs/super.c:1961 mount_bdev+0x34d/0x410 fs/super.c:1367 legacy_get_tree+0x105/0x220 fs/fs_context.c:610 vfs_get_tree+0x89/0x2f0 fs/super.c:1497 do_new_mount fs/namespace.c:3040 [inline] path_mount+0x1320/0x1fa0 fs/namespace.c:3370 do_mount fs/namespace.c:3383 [inline] __do_sys_mount fs/namespace.c:3591 [inline] __se_sys_mount fs/namespace.c:3568 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3568 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1371 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1421 free_unref_page_prepare mm/page_alloc.c:3343 [inline] free_unref_page_list+0x16f/0xf80 mm/page_alloc.c:3475 release_pages+0xff1/0x2290 mm/swap.c:980 __pagevec_release+0x77/0x100 mm/swap.c:1000 pagevec_release include/linux/pagevec.h:82 [inline] folio_batch_release include/linux/pagevec.h:146 [inline] invalidate_mapping_pagevec+0x4a6/0x5c0 mm/truncate.c:543 invalidate_bdev+0xa7/0xd0 block/bdev.c:88 invalidate_disk+0x3d/0x1b0 block/genhd.c:678 __loop_clr_fd+0x250/0x8a0 drivers/block/loop.c:1159 loop_clr_fd drivers/block/loop.c:1252 [inline] lo_ioctl+0x7d4/0x18e0 drivers/block/loop.c:1558 blkdev_ioctl+0x36e/0x800 block/ioctl.c:614 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Memory state around the buggy address: ffff888088634f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888088634f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888088635000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888088635080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888088635100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================