REISERFS (device loop0): journal params: device loop0, size 512, journal first block 18, max trans len 256, max batch 225, max commit age 30, max trans age 30 REISERFS (device loop0): checking transaction log (loop0) REISERFS (device loop0): Using r5 hash to sort names ================================================================== 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+0x80a/0x940 fs/reiserfs/namei.c:165 Read of size 4 at addr ffff888068ce1004 by task syz-executor.0/5469 CPU: 0 PID: 5469 Comm: syz-executor.0 Not tainted 6.6.0-rc2-syzkaller-00048-g42dc814987c1 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:364 [inline] print_report+0xc4/0x620 mm/kasan/report.c:475 kasan_report+0xda/0x110 mm/kasan/report.c:588 bin_search_in_dir_item fs/reiserfs/namei.c:40 [inline] search_by_entry_key+0x80a/0x940 fs/reiserfs/namei.c:165 reiserfs_find_entry+0x1dc/0xe70 fs/reiserfs/namei.c:322 reiserfs_lookup+0x1f5/0x690 fs/reiserfs/namei.c:368 __lookup_slow+0x24d/0x450 fs/namei.c:1693 lookup_one_len+0x17d/0x1b0 fs/namei.c:2745 reiserfs_lookup_privroot+0x94/0x200 fs/reiserfs/xattr.c:977 reiserfs_fill_super+0x20f9/0x3150 fs/reiserfs/super.c:2174 mount_bdev+0x1f3/0x2e0 fs/super.c:1629 legacy_get_tree+0x109/0x220 fs/fs_context.c:638 vfs_get_tree+0x8c/0x370 fs/super.c:1750 do_new_mount fs/namespace.c:3335 [inline] path_mount+0x1492/0x1ed0 fs/namespace.c:3662 do_mount fs/namespace.c:3675 [inline] __do_sys_mount fs/namespace.c:3884 [inline] __se_sys_mount fs/namespace.c:3861 [inline] __x64_sys_mount+0x293/0x310 fs/namespace.c:3861 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f995ca7e22a Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 09 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f995d851ee8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f995d851f80 RCX: 00007f995ca7e22a RDX: 0000000020000000 RSI: 0000000020000040 RDI: 00007f995d851f40 RBP: 0000000020000000 R08: 00007f995d851f80 R09: 0000000000208000 R10: 0000000000208000 R11: 0000000000000246 R12: 0000000020000040 R13: 00007f995d851f40 R14: 0000000000001126 R15: 0000000020000300 The buggy address belongs to the physical page: page:ffffea0001a33840 refcount:0 mapcount:0 mapping:0000000000000000 index:0x1 pfn:0x68ce1 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000000 ffffea0001a33888 ffffe8ffffc01760 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 0x152c4a(GFP_NOFS|__GFP_HIGHMEM|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL|__GFP_MOVABLE), pid 5033, tgid 5033 (syz-executor), ts 76821861902, free_ts 107179208637 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2cf/0x340 mm/page_alloc.c:1536 prep_new_page mm/page_alloc.c:1543 [inline] get_page_from_freelist+0xee0/0x2f20 mm/page_alloc.c:3170 __alloc_pages+0x1d0/0x4a0 mm/page_alloc.c:4426 alloc_pages+0x1a9/0x270 mm/mempolicy.c:2298 folio_alloc+0x1e/0x60 mm/mempolicy.c:2308 filemap_alloc_folio+0x3bb/0x490 mm/filemap.c:976 page_cache_ra_unbounded+0x1ac/0x5e0 mm/readahead.c:247 do_page_cache_ra mm/readahead.c:299 [inline] page_cache_ra_order+0x72b/0xa80 mm/readahead.c:546 ondemand_readahead+0x493/0x1130 mm/readahead.c:668 page_cache_async_ra mm/readahead.c:717 [inline] page_cache_async_ra+0x123/0x150 mm/readahead.c:699 filemap_readahead mm/filemap.c:2531 [inline] filemap_get_pages+0x35a/0x1830 mm/filemap.c:2572 filemap_read+0x39b/0xcf0 mm/filemap.c:2652 generic_file_read_iter+0x346/0x450 mm/filemap.c:2831 ext4_file_read_iter+0x1dc/0x6c0 fs/ext4/file.c:147 __kernel_read+0x301/0x8a0 fs/read_write.c:428 integrity_kernel_read+0x7f/0xb0 security/integrity/iint.c:195 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1136 [inline] free_unref_page_prepare+0x476/0xa40 mm/page_alloc.c:2312 free_unref_page_list+0xe6/0xb30 mm/page_alloc.c:2451 release_pages+0x32a/0x14e0 mm/swap.c:1042 __folio_batch_release+0x77/0xe0 mm/swap.c:1062 folio_batch_release include/linux/pagevec.h:83 [inline] truncate_inode_pages_range+0x34b/0x1030 mm/truncate.c:371 ext4_evict_inode+0x2c5/0x1a30 fs/ext4/inode.c:193 evict+0x2ed/0x6b0 fs/inode.c:664 iput_final fs/inode.c:1775 [inline] iput.part.0+0x55e/0x7a0 fs/inode.c:1801 iput+0x5c/0x80 fs/inode.c:1791 do_unlinkat+0x429/0x6d0 fs/namei.c:4405 __do_sys_unlink fs/namei.c:4446 [inline] __se_sys_unlink fs/namei.c:4444 [inline] __x64_sys_unlink+0xc8/0x110 fs/namei.c:4444 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff888068ce0f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888068ce0f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888068ce1000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888068ce1080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888068ce1100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================