loop0: detected capacity change from 0 to 32768 ================================================================== BUG: KASAN: use-after-free in diRead+0x975/0xbc0 fs/jfs/jfs_imap.c:329 Read of size 4 at addr ffff888040348010 by task syz.0.0/5322 CPU: 0 UID: 0 PID: 5322 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 print_address_description+0x55/0x1e0 mm/kasan/report.c:378 print_report+0x58/0x70 mm/kasan/report.c:482 kasan_report+0x117/0x150 mm/kasan/report.c:595 diRead+0x975/0xbc0 fs/jfs/jfs_imap.c:329 jfs_iget+0x89/0x470 fs/jfs/inode.c:35 jfs_lookup+0x220/0x420 fs/jfs/namei.c:1472 lookup_one_qstr_excl+0x12d/0x360 fs/namei.c:1810 __start_dirop fs/namei.c:2920 [inline] start_dirop fs/namei.c:2942 [inline] filename_create+0x20e/0x370 fs/namei.c:4951 filename_mkdirat+0xd2/0x510 fs/namei.c:5298 __do_sys_mkdirat fs/namei.c:5326 [inline] __se_sys_mkdirat+0x35/0x150 fs/namei.c:5323 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f0c9f79bcc7 Code: 00 66 90 48 89 f2 b9 00 01 00 00 48 89 fe bf 9c ff ff ff e9 db f7 ff ff 66 2e 0f 1f 84 00 00 00 00 00 90 b8 02 01 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f0ca0579e18 EFLAGS: 00000246 ORIG_RAX: 0000000000000102 RAX: ffffffffffffffda RBX: 00007f0ca0579ea0 RCX: 00007f0c9f79bcc7 RDX: 00000000000001ff RSI: 0000200000000000 RDI: 00000000ffffff9c RBP: 0000200000000f40 R08: 0000200000000000 R09: 0000000000000000 R10: 0000200000000f40 R11: 0000000000000246 R12: 0000200000000000 R13: 00007f0ca0579e60 R14: 0000000000000000 R15: 0000200000000000 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff88804034c000 pfn:0x40348 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000000 ffffea000106aa08 ffff88801fc412f0 0000000000000000 raw: ffff88804034c000 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 0x40dc0(GFP_KERNEL|__GFP_ZERO|__GFP_COMP), pid 5322, tgid 5321 (syz.0.0), ts 93149699203, free_ts 93192109268 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f9/0x250 mm/page_alloc.c:1859 prep_new_page mm/page_alloc.c:1867 [inline] get_page_from_freelist+0x21fa/0x2270 mm/page_alloc.c:3946 __alloc_frozen_pages_noprof+0x18d/0x380 mm/page_alloc.c:5304 alloc_pages_mpol+0x212/0x380 mm/mempolicy.c:2490 ___kmalloc_large_node+0x4c/0x120 mm/slub.c:5302 __kmalloc_large_noprof+0x1a/0x90 mm/slub.c:5323 _kmalloc_noprof include/linux/slab.h:966 [inline] _kzalloc_noprof include/linux/slab.h:1290 [inline] diMount+0x29/0xd80 fs/jfs/jfs_imap.c:105 jfs_mount+0x426/0x870 fs/jfs/jfs_mount.c:176 jfs_fill_super+0x69f/0xda0 fs/jfs/super.c:524 get_tree_bdev_flags+0x430/0x4f0 fs/super.c:1634 vfs_get_tree+0x92/0x2a0 fs/super.c:1694 fc_mount fs/namespace.c:1198 [inline] do_new_mount_fc fs/namespace.c:3765 [inline] do_new_mount+0x319/0xdc0 fs/namespace.c:3841 do_mount fs/namespace.c:4174 [inline] __do_sys_mount fs/namespace.c:4390 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4367 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 5323 tgid 5321 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1406 [inline] __free_frozen_pages+0xc1e/0xd10 mm/page_alloc.c:2950 diUnmount+0xff/0x130 fs/jfs/jfs_imap.c:195 jfs_mount_rw+0x2dc/0x670 fs/jfs/jfs_mount.c:239 jfs_reconfigure+0x5da/0x990 fs/jfs/super.c:409 reconfigure_super+0x232/0x8f0 fs/super.c:1020 do_remount fs/namespace.c:3407 [inline] path_mount+0xd4b/0x1040 fs/namespace.c:4153 do_mount fs/namespace.c:4174 [inline] __do_sys_mount fs/namespace.c:4390 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4367 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x174/0x580 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888040347f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888040347f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888040348000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888040348080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888040348100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================