jfs_mount: diMount failed w/rc = -5 ================================================================== BUG: KASAN: use-after-free in diFree+0x19c6/0x2660 fs/jfs/jfs_imap.c:871 Read of size 4 at addr ffff88802da78004 by task syz-executor.1/28770 CPU: 0 PID: 28770 Comm: syz-executor.1 Not tainted 5.17.0-rc6-next-20220303-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 diFree+0x19c6/0x2660 fs/jfs/jfs_imap.c:871 jfs_evict_inode+0x392/0x470 fs/jfs/inode.c:155 evict+0x2ed/0x6b0 fs/inode.c:664 iput_final fs/inode.c:1744 [inline] iput.part.0+0x562/0x820 fs/inode.c:1770 iput+0x58/0x70 fs/inode.c:1760 diFreeSpecial+0x73/0x100 fs/jfs/jfs_imap.c:548 jfs_mount+0x1c1/0x7b0 fs/jfs/jfs_mount.c:207 jfs_fill_super+0x5a4/0xc70 fs/jfs/super.c:560 mount_bdev+0x34d/0x410 fs/super.c:1367 legacy_get_tree+0x105/0x220 fs/fs_context.c:610 vfs_get_tree+0x89/0x2f0 fs/super.c:1497 do_new_mount fs/namespace.c:3025 [inline] path_mount+0x1320/0x1fa0 fs/namespace.c:3355 do_mount fs/namespace.c:3368 [inline] __do_sys_mount fs/namespace.c:3576 [inline] __se_sys_mount fs/namespace.c:3553 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3553 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7fb25168a57a Code: 48 c7 c2 b8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fb25272ff88 EFLAGS: 00000206 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 00007fb25168a57a RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fb25272ffe0 RBP: 00007fb252730020 R08: 00007fb252730020 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000020000000 R13: 0000000020000100 R14: 00007fb25272ffe0 R15: 0000000020000040 The buggy address belongs to the physical page: page:ffffea0000b69e00 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2da78 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea00006c8a08 ffffea0000b83208 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 3, migratetype Unmovable, gfp_mask 0x140cc0(GFP_USER|__GFP_COMP), pid 27682, tgid 27681 (syz-executor.1), ts 1014247463284, free_ts 1014258364459 prep_new_page mm/page_alloc.c:2438 [inline] get_page_from_freelist+0xa7f/0x3ec0 mm/page_alloc.c:4182 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5400 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2268 kmalloc_order+0x34/0xf0 mm/slab_common.c:944 kmalloc_order_trace+0x14/0x120 mm/slab_common.c:960 kmalloc_large include/linux/slab.h:513 [inline] kmalloc include/linux/slab.h:577 [inline] diMount+0x2a/0x830 fs/jfs/jfs_imap.c:105 jfs_mount+0x15d/0x7b0 fs/jfs/jfs_mount.c:100 jfs_fill_super+0x5a4/0xc70 fs/jfs/super.c:560 mount_bdev+0x34d/0x410 fs/super.c:1367 legacy_get_tree+0x105/0x220 fs/fs_context.c:610 vfs_get_tree+0x89/0x2f0 fs/super.c:1497 do_new_mount fs/namespace.c:3025 [inline] path_mount+0x1320/0x1fa0 fs/namespace.c:3355 do_mount fs/namespace.c:3368 [inline] __do_sys_mount fs/namespace.c:3576 [inline] __se_sys_mount fs/namespace.c:3553 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3553 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1353 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1403 free_unref_page_prepare mm/page_alloc.c:3325 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3420 diUnmount+0xed/0x120 fs/jfs/jfs_imap.c:195 jfs_mount+0x500/0x7b0 fs/jfs/jfs_mount.c:205 jfs_fill_super+0x5a4/0xc70 fs/jfs/super.c:560 mount_bdev+0x34d/0x410 fs/super.c:1367 legacy_get_tree+0x105/0x220 fs/fs_context.c:610 vfs_get_tree+0x89/0x2f0 fs/super.c:1497 do_new_mount fs/namespace.c:3025 [inline] path_mount+0x1320/0x1fa0 fs/namespace.c:3355 do_mount fs/namespace.c:3368 [inline] __do_sys_mount fs/namespace.c:3576 [inline] __se_sys_mount fs/namespace.c:3553 [inline] __x64_sys_mount+0x27f/0x300 fs/namespace.c:3553 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff88802da77f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88802da77f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802da78000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88802da78080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88802da78100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================