================================================================== BUG: KASAN: slab-use-after-free in jfs_evict_inode+0x4e5/0x520 fs/jfs/inode.c:157 Read of size 8 at addr ffff8880623cc5f0 by task syz-executor.1/5662 CPU: 0 PID: 5662 Comm: syz-executor.1 Not tainted 6.6.0-rc6-syzkaller-00355-gfe3cfe869d5e-dirty #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/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 jfs_evict_inode+0x4e5/0x520 fs/jfs/inode.c:157 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 diFreeSpecial+0x7a/0x110 fs/jfs/jfs_imap.c:549 jfs_mount+0x58f/0x9e0 fs/jfs/jfs_mount.c:207 jfs_fill_super+0x5a3/0xd20 fs/jfs/super.c:557 mount_bdev+0x1f3/0x2e0 fs/super.c:1629 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 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:0x7fc23327e1ea 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:00007fc234013ee8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fc234013f80 RCX: 00007fc23327e1ea RDX: 0000000020002400 RSI: 0000000020000040 RDI: 00007fc234013f40 RBP: 0000000020002400 R08: 00007fc234013f80 R09: 0000000000000080 R10: 0000000000000080 R11: 0000000000000246 R12: 0000000020000040 R13: 00007fc234013f40 R14: 0000000000002332 R15: 0000000020002500 Allocated by task 5662: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x81/0x90 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:188 [inline] slab_post_alloc_hook mm/slab.h:762 [inline] slab_alloc_node mm/slab.c:3237 [inline] slab_alloc mm/slab.c:3246 [inline] __kmem_cache_alloc_lru mm/slab.c:3423 [inline] kmem_cache_alloc_lru+0x202/0x6d0 mm/slab.c:3439 alloc_inode_sb include/linux/fs.h:2868 [inline] jfs_alloc_inode+0x25/0x60 fs/jfs/super.c:105 alloc_inode+0x5d/0x220 fs/inode.c:259 new_inode_pseudo fs/inode.c:1004 [inline] new_inode+0x22/0x260 fs/inode.c:1030 diReadSpecial+0x51/0x6e0 fs/jfs/jfs_imap.c:423 jfs_mount+0x368/0x9e0 fs/jfs/jfs_mount.c:167 jfs_fill_super+0x5a3/0xd20 fs/jfs/super.c:557 mount_bdev+0x1f3/0x2e0 fs/super.c:1629 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 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 Freed by task 2785: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x28/0x40 mm/kasan/generic.c:522 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x138/0x190 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:164 [inline] __cache_free mm/slab.c:3370 [inline] __do_kmem_cache_free mm/slab.c:3557 [inline] kmem_cache_free+0x104/0x380 mm/slab.c:3582 i_callback+0x43/0x70 fs/inode.c:248 rcu_do_batch kernel/rcu/tree.c:2139 [inline] rcu_core+0x805/0x1bb0 kernel/rcu/tree.c:2403 __do_softirq+0x218/0x965 kernel/softirq.c:553 Last potentially related work creation: kasan_save_stack+0x33/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0x78/0x80 mm/kasan/generic.c:492 __call_rcu_common.constprop.0+0x9a/0x790 kernel/rcu/tree.c:2653 destroy_inode+0x129/0x1b0 fs/inode.c:314 iput_final fs/inode.c:1775 [inline] iput.part.0+0x55e/0x7a0 fs/inode.c:1801 iput+0x5c/0x80 fs/inode.c:1791 diFreeSpecial+0x7a/0x110 fs/jfs/jfs_imap.c:549 jfs_mount+0x501/0x9e0 fs/jfs/jfs_mount.c:194 jfs_fill_super+0x5a3/0xd20 fs/jfs/super.c:557 mount_bdev+0x1f3/0x2e0 fs/super.c:1629 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 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 The buggy address belongs to the object at ffff8880623cc240 which belongs to the cache jfs_ip of size 2240 The buggy address is located 944 bytes inside of freed 2240-byte region [ffff8880623cc240, ffff8880623ccb00) The buggy address belongs to the physical page: page:ffffea000188f300 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880623ccfff pfn:0x623cc memcg:ffff888014ec05c1 flags: 0xfff00000000800(slab|node=0|zone=1|lastcpupid=0x7ff) page_type: 0x1() raw: 00fff00000000800 ffff888014f62900 ffffea000188f2d0 ffff888015349950 raw: ffff8880623ccfff ffff8880623cc240 0000000100000001 ffff888014ec05c1 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Reclaimable, gfp_mask 0x342050(__GFP_IO|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE|__GFP_RECLAIMABLE), pid 5662, tgid 5661 (syz-executor.1), ts 133529530977, free_ts 25555871525 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_node include/linux/gfp.h:237 [inline] kmem_getpages mm/slab.c:1356 [inline] cache_grow_begin+0x99/0x3a0 mm/slab.c:2550 cache_alloc_refill+0x294/0x3a0 mm/slab.c:2923 ____cache_alloc mm/slab.c:2999 [inline] ____cache_alloc mm/slab.c:2982 [inline] __do_cache_alloc mm/slab.c:3182 [inline] slab_alloc_node mm/slab.c:3230 [inline] slab_alloc mm/slab.c:3246 [inline] __kmem_cache_alloc_lru mm/slab.c:3423 [inline] kmem_cache_alloc_lru+0x566/0x6d0 mm/slab.c:3439 alloc_inode_sb include/linux/fs.h:2868 [inline] jfs_alloc_inode+0x25/0x60 fs/jfs/super.c:105 alloc_inode+0x5d/0x220 fs/inode.c:259 new_inode_pseudo fs/inode.c:1004 [inline] new_inode+0x22/0x260 fs/inode.c:1030 diReadSpecial+0x51/0x6e0 fs/jfs/jfs_imap.c:423 jfs_mount+0x368/0x9e0 fs/jfs/jfs_mount.c:167 jfs_fill_super+0x5a3/0xd20 fs/jfs/super.c:557 mount_bdev+0x1f3/0x2e0 fs/super.c:1629 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 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 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+0x33/0x3b0 mm/page_alloc.c:2405 free_contig_range+0xb6/0x190 mm/page_alloc.c:6342 destroy_args+0x768/0x990 mm/debug_vm_pgtable.c:1028 debug_vm_pgtable+0x1d79/0x3e00 mm/debug_vm_pgtable.c:1408 do_one_initcall+0x117/0x630 init/main.c:1232 do_initcall_level init/main.c:1294 [inline] do_initcalls init/main.c:1310 [inline] do_basic_setup init/main.c:1329 [inline] kernel_init_freeable+0x5c2/0x900 init/main.c:1547 kernel_init+0x1c/0x2a0 init/main.c:1437 ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x11/0x20 arch/x86/entry/entry_64.S:304 Memory state around the buggy address: ffff8880623cc480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880623cc500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880623cc580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880623cc600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880623cc680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================