loop0: detected capacity change from 0 to 14901 read_mapping_page failed! jfs_mount: diMount failed w/rc = -5 ================================================================== BUG: KASAN: use-after-free in diFree+0x17ac/0x2648 fs/jfs/jfs_imap.c:871 Read of size 4 at addr ffff0000d8130004 by task syz-executor453/4290 CPU: 0 PID: 4290 Comm: syz-executor453 Not tainted 6.1.29-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x174/0x4c0 mm/kasan/report.c:395 kasan_report+0xd4/0x130 mm/kasan/report.c:495 __asan_report_load4_noabort+0x2c/0x38 mm/kasan/report_generic.c:350 diFree+0x17ac/0x2648 fs/jfs/jfs_imap.c:871 jfs_evict_inode+0x2d0/0x3f4 fs/jfs/inode.c:156 evict+0x260/0x68c fs/inode.c:664 iput_final fs/inode.c:1747 [inline] iput+0x7c0/0x8a4 fs/inode.c:1773 diFreeSpecial+0x78/0x108 fs/jfs/jfs_imap.c:548 jfs_mount+0x53c/0x7a4 fs/jfs/jfs_mount.c:203 jfs_fill_super+0x464/0x9f0 fs/jfs/super.c:556 mount_bdev+0x26c/0x368 fs/super.c:1423 jfs_do_mount+0x44/0x58 fs/jfs/super.c:670 legacy_get_tree+0xd4/0x16c fs/fs_context.c:610 vfs_get_tree+0x90/0x274 fs/super.c:1553 do_new_mount+0x25c/0x8c8 fs/namespace.c:3040 path_mount+0x590/0xe58 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] __arm64_sys_mount+0x45c/0x594 fs/namespace.c:3568 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 Allocated by task 3840: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0xac/0xc4 mm/kasan/common.c:383 kasan_kmalloc include/linux/kasan.h:211 [inline] __do_kmalloc_node mm/slab_common.c:955 [inline] __kmalloc+0xd8/0x1c4 mm/slab_common.c:968 kmalloc include/linux/slab.h:558 [inline] tomoyo_realpath_from_path+0xc8/0x4cc security/tomoyo/realpath.c:251 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x208/0x568 security/tomoyo/file.c:822 tomoyo_inode_getattr+0x28/0x38 security/tomoyo/tomoyo.c:122 security_inode_getattr+0xd8/0x124 security/security.c:1347 vfs_getattr fs/stat.c:158 [inline] vfs_statx+0x184/0x420 fs/stat.c:233 vfs_fstatat fs/stat.c:267 [inline] __do_sys_newfstatat fs/stat.c:437 [inline] __se_sys_newfstatat fs/stat.c:431 [inline] __arm64_sys_newfstatat+0x134/0x1c0 fs/stat.c:431 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 Freed by task 3840: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:516 ____kasan_slab_free+0x144/0x1c0 mm/kasan/common.c:236 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook mm/slub.c:1750 [inline] slab_free mm/slub.c:3661 [inline] __kmem_cache_free+0x2c0/0x4b4 mm/slub.c:3674 kfree+0xcc/0x1b8 mm/slab_common.c:1007 tomoyo_realpath_from_path+0x484/0x4cc security/tomoyo/realpath.c:286 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x208/0x568 security/tomoyo/file.c:822 tomoyo_inode_getattr+0x28/0x38 security/tomoyo/tomoyo.c:122 security_inode_getattr+0xd8/0x124 security/security.c:1347 vfs_getattr fs/stat.c:158 [inline] vfs_statx+0x184/0x420 fs/stat.c:233 vfs_fstatat fs/stat.c:267 [inline] __do_sys_newfstatat fs/stat.c:437 [inline] __se_sys_newfstatat fs/stat.c:431 [inline] __arm64_sys_newfstatat+0x134/0x1c0 fs/stat.c:431 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:206 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:581 The buggy address belongs to the object at ffff0000d8130000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 4 bytes inside of 4096-byte region [ffff0000d8130000, ffff0000d8131000) The buggy address belongs to the physical page: page:00000000896df55b refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x118130 head:00000000896df55b order:3 compound_mapcount:0 compound_pincount:0 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 fffffc000354b800 dead000000000003 ffff0000c0002a80 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000d812ff00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000d812ff80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000d8130000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000d8130080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000d8130100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== imap: 00000000d883ed5a: c7481500 ffff0000 00000f00 06600263 imap: 000000001ff316ea: 00000000 00000000 00000000 00000000 ERROR: (device loop0): diFree: inum = 2, iagno = 0, nextiag = -65536 Mount JFS Failure: -5 jfs_mount failed w/return code = -5