================================================================================ UBSAN: array-index-out-of-bounds in fs/jfs/jfs_dmap.c:2317:2 index 2621480 is out of range for type 's64[128]' (aka 'long long[128]') CPU: 0 PID: 4732 Comm: syz.2.113 Not tainted 5.15.189-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call trace: dump_backtrace+0x0/0x43c arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 ubsan_epilogue+0x14/0x48 lib/ubsan.c:151 __ubsan_handle_out_of_bounds+0xd4/0x108 lib/ubsan.c:282 dbAllocBits+0x874/0x8bc fs/jfs/jfs_dmap.c:2317 dbAllocDmap fs/jfs/jfs_dmap.c:2094 [inline] dbAllocNear+0x25c/0x350 fs/jfs/jfs_dmap.c:1315 dbAlloc+0x760/0x978 fs/jfs/jfs_dmap.c:832 extBalloc fs/jfs/jfs_extent.c:523 [inline] extAlloc+0x3f4/0xdc4 fs/jfs/jfs_extent.c:125 jfs_get_block+0x2bc/0x8ec fs/jfs/inode.c:258 __mpage_writepage+0x390/0x154c fs/mpage.c:564 write_cache_pages+0x7c8/0xde4 mm/page-writeback.c:2277 mpage_writepages+0xe4/0x218 fs/mpage.c:712 jfs_writepages+0x30/0x40 fs/jfs/inode.c:293 do_writepages+0x36c/0x578 mm/page-writeback.c:2386 filemap_fdatawrite_wbc+0x1d4/0x234 mm/filemap.c:400 __filemap_fdatawrite_range mm/filemap.c:433 [inline] file_write_and_wait_range+0x100/0x1c0 mm/filemap.c:810 jfs_fsync+0x78/0x1bc fs/jfs/file.c:24 vfs_fsync_range fs/sync.c:188 [inline] vfs_fsync fs/sync.c:202 [inline] do_fsync fs/sync.c:212 [inline] __do_sys_fdatasync fs/sync.c:225 [inline] __se_sys_fdatasync fs/sync.c:223 [inline] __arm64_sys_fdatasync+0xac/0x104 fs/sync.c:223 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 ================================================================================ ================================================================================ UBSAN: array-index-out-of-bounds in fs/jfs/jfs_extent.c:549:16 index 2621480 is out of range for type 'atomic_t[128]' CPU: 0 PID: 4732 Comm: syz.2.113 Not tainted 5.15.189-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call trace: dump_backtrace+0x0/0x43c arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106 dump_stack+0x1c/0x5c lib/dump_stack.c:113 ubsan_epilogue+0x14/0x48 lib/ubsan.c:151 __ubsan_handle_out_of_bounds+0xd4/0x108 lib/ubsan.c:282 extBalloc fs/jfs/jfs_extent.c:549 [inline] extAlloc+0xcc0/0xdc4 fs/jfs/jfs_extent.c:125 jfs_get_block+0x2bc/0x8ec fs/jfs/inode.c:258 __mpage_writepage+0x390/0x154c fs/mpage.c:564 write_cache_pages+0x7c8/0xde4 mm/page-writeback.c:2277 mpage_writepages+0xe4/0x218 fs/mpage.c:712 jfs_writepages+0x30/0x40 fs/jfs/inode.c:293 do_writepages+0x36c/0x578 mm/page-writeback.c:2386 filemap_fdatawrite_wbc+0x1d4/0x234 mm/filemap.c:400 __filemap_fdatawrite_range mm/filemap.c:433 [inline] file_write_and_wait_range+0x100/0x1c0 mm/filemap.c:810 jfs_fsync+0x78/0x1bc fs/jfs/file.c:24 vfs_fsync_range fs/sync.c:188 [inline] vfs_fsync fs/sync.c:202 [inline] do_fsync fs/sync.c:212 [inline] __do_sys_fdatasync fs/sync.c:225 [inline] __se_sys_fdatasync fs/sync.c:223 [inline] __arm64_sys_fdatasync+0xac/0x104 fs/sync.c:223 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 ================================================================================ ================================================================== BUG: KASAN: slab-out-of-bounds in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: slab-out-of-bounds in atomic_inc include/linux/atomic/atomic-instrumented.h:181 [inline] BUG: KASAN: slab-out-of-bounds in extBalloc fs/jfs/jfs_extent.c:549 [inline] BUG: KASAN: slab-out-of-bounds in extAlloc+0x734/0xdc4 fs/jfs/jfs_extent.c:125 Write of size 4 at addr ffff0000e8f23580 by task syz.2.113/4732 CPU: 0 PID: 4732 Comm: syz.2.113 Not tainted 5.15.189-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call trace: dump_backtrace+0x0/0x43c arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack+0x30/0x40 lib/dump_stack.c:88 dump_stack_lvl+0xf8/0x160 lib/dump_stack.c:106 print_address_description+0x78/0x30c mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0xec/0x15c mm/kasan/report.c:451 check_region_inline mm/kasan/generic.c:-1 [inline] kasan_check_range+0x270/0x2b0 mm/kasan/generic.c:189 __kasan_check_write+0x44/0x54 mm/kasan/shadow.c:37 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_inc include/linux/atomic/atomic-instrumented.h:181 [inline] extBalloc fs/jfs/jfs_extent.c:549 [inline] extAlloc+0x734/0xdc4 fs/jfs/jfs_extent.c:125 jfs_get_block+0x2bc/0x8ec fs/jfs/inode.c:258 __mpage_writepage+0x390/0x154c fs/mpage.c:564 write_cache_pages+0x7c8/0xde4 mm/page-writeback.c:2277 mpage_writepages+0xe4/0x218 fs/mpage.c:712 jfs_writepages+0x30/0x40 fs/jfs/inode.c:293 do_writepages+0x36c/0x578 mm/page-writeback.c:2386 filemap_fdatawrite_wbc+0x1d4/0x234 mm/filemap.c:400 __filemap_fdatawrite_range mm/filemap.c:433 [inline] file_write_and_wait_range+0x100/0x1c0 mm/filemap.c:810 jfs_fsync+0x78/0x1bc fs/jfs/file.c:24 vfs_fsync_range fs/sync.c:188 [inline] vfs_fsync fs/sync.c:202 [inline] do_fsync fs/sync.c:212 [inline] __do_sys_fdatasync fs/sync.c:225 [inline] __se_sys_fdatasync fs/sync.c:223 [inline] __arm64_sys_fdatasync+0xac/0x104 fs/sync.c:223 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Allocated by task 4050: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] __kasan_kmalloc+0xb0/0xf0 mm/kasan/common.c:522 kasan_kmalloc include/linux/kasan.h:264 [inline] __kmalloc+0x298/0x44c mm/slub.c:4407 kmalloc include/linux/slab.h:609 [inline] kzalloc include/linux/slab.h:735 [inline] tomoyo_encode2 security/tomoyo/realpath.c:45 [inline] tomoyo_encode+0x274/0x4a4 security/tomoyo/realpath.c:80 tomoyo_realpath_from_path+0x4bc/0x510 security/tomoyo/realpath.c:288 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path2_perm+0x208/0x660 security/tomoyo/file.c:923 tomoyo_path_rename+0xd4/0x120 security/tomoyo/tomoyo.c:278 security_path_rename+0x1cc/0x274 security/security.c:1205 do_renameat2+0x5bc/0xcdc fs/namei.c:4972 __do_sys_renameat fs/namei.c:5025 [inline] __se_sys_renameat fs/namei.c:5022 [inline] __arm64_sys_renameat+0xc8/0xe4 fs/namei.c:5022 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Freed by task 4050: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x84 mm/kasan/common.c:46 kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360 ____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0x128/0x1e8 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kfree+0x170/0x40c mm/slub.c:4559 tomoyo_path2_perm+0x4fc/0x660 security/tomoyo/file.c:947 tomoyo_path_rename+0xd4/0x120 security/tomoyo/tomoyo.c:278 security_path_rename+0x1cc/0x274 security/security.c:1205 do_renameat2+0x5bc/0xcdc fs/namei.c:4972 __do_sys_renameat fs/namei.c:5025 [inline] __se_sys_renameat fs/namei.c:5022 [inline] __arm64_sys_renameat+0xc8/0xe4 fs/namei.c:5022 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x78/0x1e0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0xcc/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 The buggy address belongs to the object at ffff0000e8f23500 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 0 bytes to the right of 128-byte region [ffff0000e8f23500, ffff0000e8f23580) The buggy address belongs to the page: page:00000000f9cb2d5b refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x128f23 flags: 0x5ffc00000000200(slab|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000000200 dead000000000100 dead000000000122 ffff0000c0002300 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000e8f23480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000e8f23500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000e8f23580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff0000e8f23600: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000e8f23680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ERROR: (device loop2): dbAlloc: the hint is outside the map ERROR: (device loop2): remounting filesystem as read-only attempt to access beyond end of device loop2: rw=2049, want=171801313640, limit=32768 ERROR: (device loop2): dbAlloc: the hint is outside the map attempt to access beyond end of device loop2: rw=2049, want=171801313648, limit=32768