... Log Wrap ... Log Wrap ... Log Wrap ... ... Log Wrap ... Log Wrap ... Log Wrap ... ------------[ cut here ]------------ UBSAN: array-index-out-of-bounds in fs/jfs/jfs_dtree.c:2649:28 index -128 is out of range for type 'struct dtslot[128]' CPU: 1 UID: 0 PID: 7353 Comm: syz.3.169 Not tainted 6.13.0-rc7-syzkaller-g1950a0af2d55 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:466 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 dump_stack+0x1c/0x28 lib/dump_stack.c:129 ubsan_epilogue lib/ubsan.c:231 [inline] __ubsan_handle_out_of_bounds+0xf8/0x148 lib/ubsan.c:429 add_missing_indices+0x6e4/0xa8c fs/jfs/jfs_dtree.c:2649 jfs_readdir+0x18ac/0x3030 fs/jfs/jfs_dtree.c:3019 wrap_directory_iterator+0xa8/0xf4 fs/readdir.c:65 shared_jfs_readdir+0x30/0x40 fs/jfs/namei.c:1540 iterate_dir+0x408/0x648 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:403 [inline] __se_sys_getdents64 fs/readdir.c:389 [inline] __arm64_sys_getdents64+0x1c0/0x490 fs/readdir.c:389 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 ---[ end trace ]--- ================================================================== BUG: KASAN: slab-use-after-free in diWrite+0xb48/0x15cc fs/jfs/jfs_imap.c:753 Read of size 32 at addr ffff0000f156ae98 by task syz.3.169/7353 CPU: 0 UID: 0 PID: 7353 Comm: syz.3.169 Not tainted 6.13.0-rc7-syzkaller-g1950a0af2d55 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call trace: show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:466 (C) __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x198/0x538 mm/kasan/report.c:489 kasan_report+0xd8/0x138 mm/kasan/report.c:602 kasan_check_range+0x268/0x2a8 mm/kasan/generic.c:189 __asan_memcpy+0x3c/0x84 mm/kasan/shadow.c:105 diWrite+0xb48/0x15cc fs/jfs/jfs_imap.c:753 txCommit+0x750/0x5504 fs/jfs/jfs_txnmgr.c:1255 add_missing_indices+0x760/0xa8c fs/jfs/jfs_dtree.c:2663 jfs_readdir+0x18ac/0x3030 fs/jfs/jfs_dtree.c:3019 wrap_directory_iterator+0xa8/0xf4 fs/readdir.c:65 shared_jfs_readdir+0x30/0x40 fs/jfs/namei.c:1540 iterate_dir+0x408/0x648 fs/readdir.c:108 __do_sys_getdents64 fs/readdir.c:403 [inline] __se_sys_getdents64 fs/readdir.c:389 [inline] __arm64_sys_getdents64+0x1c0/0x490 fs/readdir.c:389 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 Allocated by task 6550: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_alloc_info+0x40/0x50 mm/kasan/generic.c:568 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x74/0x8c mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4119 [inline] slab_alloc_node mm/slub.c:4168 [inline] kmem_cache_alloc_lru_noprof+0x258/0x414 mm/slub.c:4187 jfs_alloc_inode+0x2c/0x68 fs/jfs/super.c:105 alloc_inode+0x68/0x19c fs/inode.c:336 iget_locked+0x184/0x814 fs/inode.c:1487 jfs_iget+0x30/0x378 fs/jfs/inode.c:29 jfs_fill_super+0x748/0xba0 fs/jfs/super.c:547 get_tree_bdev_flags+0x38c/0x494 fs/super.c:1636 get_tree_bdev+0x2c/0x3c fs/super.c:1659 jfs_get_tree+0x28/0x38 fs/jfs/super.c:635 vfs_get_tree+0x90/0x28c fs/super.c:1814 do_new_mount+0x278/0x900 fs/namespace.c:3511 path_mount+0x590/0xe04 fs/namespace.c:3838 do_mount fs/namespace.c:3851 [inline] __do_sys_mount fs/namespace.c:4061 [inline] __se_sys_mount fs/namespace.c:4038 [inline] __arm64_sys_mount+0x4d4/0x5ac fs/namespace.c:4038 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:744 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 Freed by task 24: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_free_info+0x54/0x6c mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x64/0x8c mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4613 [inline] kmem_cache_free+0x198/0x554 mm/slub.c:4715 jfs_free_inode+0x28/0x38 fs/jfs/super.c:116 i_callback+0x50/0x78 fs/inode.c:325 rcu_do_batch kernel/rcu/tree.c:2567 [inline] rcu_core+0x898/0x1b5c kernel/rcu/tree.c:2823 rcu_core_si+0x10/0x1c kernel/rcu/tree.c:2840 handle_softirqs+0x320/0xd34 kernel/softirq.c:561 run_ksoftirqd+0x70/0xc0 kernel/softirq.c:950 smpboot_thread_fn+0x4b0/0x90c kernel/smpboot.c:164 kthread+0x288/0x310 kernel/kthread.c:389 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:862 Last potentially related work creation: kasan_save_stack+0x40/0x6c mm/kasan/common.c:47 __kasan_record_aux_stack+0xb8/0xd0 mm/kasan/generic.c:544 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:554 __call_rcu_common kernel/rcu/tree.c:3086 [inline] call_rcu+0x104/0xb00 kernel/rcu/tree.c:3190 destroy_inode fs/inode.c:391 [inline] evict+0x7b4/0x978 fs/inode.c:827 dispose_list fs/inode.c:845 [inline] evict_inodes+0x708/0x7a0 fs/inode.c:899 generic_shutdown_super+0xa0/0x2bc fs/super.c:627 kill_block_super+0x44/0x90 fs/super.c:1710 deactivate_locked_super+0xc4/0x12c fs/super.c:473 deactivate_super+0xe0/0x100 fs/super.c:506 cleanup_mnt+0x34c/0x3dc fs/namespace.c:1373 __cleanup_mnt+0x20/0x30 fs/namespace.c:1380 task_work_run+0x230/0x2e0 kernel/task_work.c:239 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] do_notify_resume+0x178/0x1f4 arch/arm64/kernel/entry-common.c:151 exit_to_user_mode_prepare arch/arm64/kernel/entry-common.c:169 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:178 [inline] el0_svc+0xac/0x168 arch/arm64/kernel/entry-common.c:745 el0t_64_sync_handler+0x84/0x108 arch/arm64/kernel/entry-common.c:762 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:600 The buggy address belongs to the object at ffff0000f156ae18 which belongs to the cache jfs_ip of size 2232 The buggy address is located 128 bytes inside of freed 2232-byte region [ffff0000f156ae18, ffff0000f156b6d0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff0000f156b750 pfn:0x131568 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff0000d3738901 flags: 0x5ffc00000000040(head|node=0|zone=2|lastcpupid=0x7ff) page_type: f5(slab) raw: 05ffc00000000040 ffff0000c3e17500 dead000000000122 0000000000000000 raw: ffff0000f156b750 00000000800d0008 00000001f5000000 ffff0000d3738901 head: 05ffc00000000040 ffff0000c3e17500 dead000000000122 0000000000000000 head: ffff0000f156b750 00000000800d0008 00000001f5000000 ffff0000d3738901 head: 05ffc00000000003 fffffdffc3c55a01 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000f156ad80: 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000f156ae00: fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000f156ae80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000f156af00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000f156af80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ... Log Wrap ... Log Wrap ... Log Wrap ... ... Log Wrap ... Log Wrap ... Log Wrap ... ... Log Wrap ... Log Wrap ... Log Wrap ... ERROR: (device loop3): jfs_readdir: JFS:Dtree error: ino = 2, bn=0, index = 0 ERROR: (device loop3): remounting filesystem as read-only JFS: Invalid stbl[1] = -128 for inode 2, block = 0