warning: checkpointing journal with EXT4_IOC_CHECKPOINT_FLAG_ZEROOUT can be slow ================================================================== BUG: KASAN: use-after-free in __lock_acquire+0xda/0x2b00 kernel/locking/lockdep.c:4897 Read of size 8 at addr ffff888073b03b78 by task syz-executor.4/15154 CPU: 1 PID: 15154 Comm: syz-executor.4 Not tainted 5.17.0-rc8-syzkaller-00003-g56e337f2cf13 #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+0x1dc/0x2d8 lib/dump_stack.c:106 print_address_description+0x65/0x3a0 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report+0x19a/0x1f0 mm/kasan/report.c:459 __lock_acquire+0xda/0x2b00 kernel/locking/lockdep.c:4897 lock_acquire+0x19f/0x4d0 kernel/locking/lockdep.c:5639 __raw_spin_lock include/linux/spinlock_api_smp.h:133 [inline] _raw_spin_lock+0x2a/0x40 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:349 [inline] jbd2_journal_wait_updates+0x2cb/0x400 fs/jbd2/transaction.c:861 jbd2_journal_lock_updates+0x33b/0x420 fs/jbd2/transaction.c:896 ext4_ioctl_checkpoint fs/ext4/ioctl.c:1085 [inline] __ext4_ioctl fs/ext4/ioctl.c:1562 [inline] ext4_ioctl+0x34c7/0x65d0 fs/ext4/ioctl.c:1578 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7ff81458c049 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007ff812f01168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007ff81469ef60 RCX: 00007ff81458c049 RDX: 0000000020000000 RSI: 000000004004662b RDI: 0000000000000003 RBP: 00007ff8145e608d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffdfd17fa7f R14: 00007ff812f01300 R15: 0000000000022000 Allocated by task 3624: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] __kasan_slab_alloc+0xb2/0xe0 mm/kasan/common.c:469 kasan_slab_alloc include/linux/kasan.h:260 [inline] slab_post_alloc_hook mm/slab.h:732 [inline] slab_alloc_node mm/slub.c:3230 [inline] slab_alloc mm/slub.c:3238 [inline] kmem_cache_alloc+0x1c9/0x310 mm/slub.c:3243 kmem_cache_zalloc include/linux/slab.h:704 [inline] start_this_handle+0x328/0x1630 fs/jbd2/transaction.c:375 jbd2__journal_start+0x2ca/0x5b0 fs/jbd2/transaction.c:525 __ext4_journal_start_sb+0x111/0x1e0 fs/ext4/ext4_jbd2.c:105 __ext4_new_inode+0x1421/0x5740 fs/ext4/ialloc.c:1080 ext4_mkdir+0x3ea/0xc00 fs/ext4/namei.c:2929 vfs_mkdir+0x2f6/0x4d0 fs/namei.c:3933 do_mkdirat+0x277/0x530 fs/namei.c:3959 __do_sys_mkdir fs/namei.c:3979 [inline] __se_sys_mkdir fs/namei.c:3977 [inline] __x64_sys_mkdir+0x6a/0x80 fs/namei.c:3977 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 15152: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x126/0x180 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:236 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x12e/0x1a0 mm/slub.c:1754 slab_free mm/slub.c:3509 [inline] kmem_cache_free+0xb6/0x1c0 mm/slub.c:3526 __jbd2_journal_remove_checkpoint+0x529/0x5c0 fs/jbd2/checkpoint.c:735 jbd2_log_do_checkpoint+0x1086/0x1550 fs/jbd2/checkpoint.c:354 jbd2_journal_flush+0x298/0xd70 fs/jbd2/journal.c:2465 ext4_ioctl_checkpoint fs/ext4/ioctl.c:1086 [inline] __ext4_ioctl fs/ext4/ioctl.c:1562 [inline] ext4_ioctl+0x3512/0x65d0 fs/ext4/ioctl.c:1578 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl+0xfb/0x170 fs/ioctl.c:860 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff888073b03b00 which belongs to the cache jbd2_transaction_s of size 280 The buggy address is located 120 bytes inside of 280-byte region [ffff888073b03b00, ffff888073b03c18) The buggy address belongs to the page: page:ffffea0001cec080 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888073b02000 pfn:0x73b02 head:ffffea0001cec080 order:1 compound_mapcount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffffea0000a97800 dead000000000003 ffff8880186a8a00 raw: ffff888073b02000 0000000080150012 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Reclaimable, gfp_mask 0x1d2050(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 4180, ts 143760463669, free_ts 137319366024 prep_new_page mm/page_alloc.c:2434 [inline] get_page_from_freelist+0x729/0x9e0 mm/page_alloc.c:4165 __alloc_pages+0x255/0x580 mm/page_alloc.c:5389 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab+0xce/0x3f0 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0x3fe/0xc30 mm/slub.c:3018 __slab_alloc mm/slub.c:3105 [inline] slab_alloc_node mm/slub.c:3196 [inline] slab_alloc mm/slub.c:3238 [inline] kmem_cache_alloc+0x276/0x310 mm/slub.c:3243 kmem_cache_zalloc include/linux/slab.h:704 [inline] start_this_handle+0x328/0x1630 fs/jbd2/transaction.c:375 jbd2__journal_start+0x2ca/0x5b0 fs/jbd2/transaction.c:525 __ext4_journal_start_sb+0x111/0x1e0 fs/ext4/ext4_jbd2.c:105 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline] ext4_dirty_inode+0x8a/0x100 fs/ext4/inode.c:5899 __mark_inode_dirty+0xb6/0x8f0 fs/fs-writeback.c:2409 mark_inode_dirty include/linux/fs.h:2367 [inline] generic_write_end+0x218/0x360 fs/buffer.c:2203 ext4_da_write_end+0x7bb/0x870 fs/ext4/inode.c:3042 generic_perform_write+0x3da/0x600 mm/filemap.c:3776 ext4_buffered_write_iter+0x3b5/0x580 fs/ext4/file.c:268 ext4_file_write_iter+0x8f7/0x1bb0 do_iter_readv_writev+0x54f/0x740 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1352 [inline] free_pcp_prepare+0xd1c/0xe00 mm/page_alloc.c:1404 free_unref_page_prepare mm/page_alloc.c:3325 [inline] free_unref_page+0x7d/0x580 mm/page_alloc.c:3404 do_slab_free mm/slub.c:3497 [inline] ___cache_free+0x107/0x160 mm/slub.c:3516 qlist_free_all mm/kasan/quarantine.c:176 [inline] kasan_quarantine_reduce+0x169/0x1f0 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:260 [inline] slab_post_alloc_hook mm/slab.h:732 [inline] slab_alloc_node mm/slub.c:3230 [inline] slab_alloc mm/slub.c:3238 [inline] kmem_cache_alloc+0x1c9/0x310 mm/slub.c:3243 getname_flags+0xba/0x650 fs/namei.c:138 user_path_at_empty+0x2a/0x1a0 fs/namei.c:2850 user_path_at include/linux/namei.h:57 [inline] vfs_statx+0x10f/0x3b0 fs/stat.c:221 vfs_fstatat fs/stat.c:243 [inline] __do_sys_newfstatat fs/stat.c:412 [inline] __se_sys_newfstatat+0xc8/0x760 fs/stat.c:406 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x44/0xd0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff888073b03a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888073b03a80: fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888073b03b00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888073b03b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888073b03c00: fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================