loop5: detected capacity change from 0 to 1024 EXT4-fs error (device loop5): ext4_map_blocks:745: inode #3: block 1: comm syz.5.173: lblock 1 mapped to illegal pblock 1 (length 1) ================================================================== BUG: KASAN: use-after-free in hlist_add_head include/linux/list.h:930 [inline] BUG: KASAN: use-after-free in enqueue_timer+0xae/0x480 kernel/time/timer.c:611 Write of size 8 at addr ffff88813a0264c0 by task syz.5.173/1046 CPU: 0 PID: 1046 Comm: syz.5.173 Not tainted 6.1.138-syzkaller-00046-gdb710ea87c32 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:88 dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106 print_address_description+0x71/0x210 mm/kasan/report.c:316 print_report+0x4a/0x60 mm/kasan/report.c:427 kasan_report+0x122/0x150 mm/kasan/report.c:531 __asan_report_store8_noabort+0x17/0x20 mm/kasan/report_generic.c:356 hlist_add_head include/linux/list.h:930 [inline] enqueue_timer+0xae/0x480 kernel/time/timer.c:611 __mod_timer+0x79f/0xb30 kernel/time/timer.c:-1 mod_timer+0x1f/0x30 kernel/time/timer.c:1172 ext4_update_super+0xa54/0xe40 fs/ext4/super.c:6056 ext4_commit_super+0xe3/0x4b0 fs/ext4/super.c:6075 ext4_handle_error+0x5c8/0x860 fs/ext4/super.c:678 __ext4_error_inode+0x2ce/0x560 fs/ext4/super.c:811 __check_block_validity fs/ext4/inode.c:415 [inline] ext4_map_blocks+0xf5c/0x1b60 fs/ext4/inode.c:-1 ext4_getblk+0x1c1/0x6d0 fs/ext4/inode.c:890 ext4_bread+0x2b/0x170 fs/ext4/inode.c:946 ext4_quota_write+0x230/0x550 fs/ext4/super.c:7176 write_blk+0x12e/0x250 fs/quota/quota_tree.c:70 do_insert_tree+0xafb/0x1060 fs/quota/quota_tree.c:407 dq_insert_tree fs/quota/quota_tree.c:432 [inline] qtree_write_dquot+0x4a6/0x5c0 fs/quota/quota_tree.c:451 v2_write_dquot+0x130/0x1a0 fs/quota/quota_v2.c:361 dquot_acquire+0x30c/0x560 fs/quota/dquot.c:472 ext4_acquire_dquot+0x2d9/0x4a0 fs/ext4/super.c:6785 dqget+0xad0/0xf60 fs/quota/dquot.c:988 __dquot_initialize+0x3c7/0xc20 fs/quota/dquot.c:1517 dquot_initialize+0x1a/0x20 fs/quota/dquot.c:1579 ext4_process_orphan+0x59/0x320 fs/ext4/orphan.c:329 ext4_orphan_cleanup+0xb02/0x1210 fs/ext4/orphan.c:474 __ext4_fill_super fs/ext4/super.c:5510 [inline] ext4_fill_super+0x73ad/0x78f0 fs/ext4/super.c:5641 get_tree_bdev+0x444/0x680 fs/super.c:1368 ext4_get_tree+0x1c/0x20 fs/ext4/super.c:5671 vfs_get_tree+0x9a/0x270 fs/super.c:1575 do_new_mount+0x25a/0xa20 fs/namespace.c:3057 path_mount+0x675/0x1010 fs/namespace.c:3387 do_mount fs/namespace.c:3400 [inline] __do_sys_mount fs/namespace.c:3608 [inline] __se_sys_mount+0x318/0x380 fs/namespace.c:3585 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3585 x64_sys_call+0x65d/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:166 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7fc65639010a Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fc657294e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fc657294ef0 RCX: 00007fc65639010a RDX: 0000200000000140 RSI: 0000200000000040 RDI: 00007fc657294eb0 RBP: 0000200000000140 R08: 00007fc657294ef0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000200000000040 R13: 00007fc657294eb0 R14: 0000000000000600 R15: 0000200000000680 Allocated by task 824: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_alloc_info+0x25/0x30 mm/kasan/generic.c:505 ____kasan_kmalloc mm/kasan/common.c:379 [inline] __kasan_kmalloc+0x95/0xb0 mm/kasan/common.c:388 kasan_kmalloc include/linux/kasan.h:212 [inline] kmalloc_trace+0x40/0xb0 mm/slab_common.c:1033 kmalloc include/linux/slab.h:563 [inline] kzalloc include/linux/slab.h:699 [inline] ext4_alloc_sbi fs/ext4/super.c:4253 [inline] ext4_fill_super+0x107/0x78f0 fs/ext4/super.c:5628 get_tree_bdev+0x444/0x680 fs/super.c:1368 ext4_get_tree+0x1c/0x20 fs/ext4/super.c:5671 vfs_get_tree+0x9a/0x270 fs/super.c:1575 do_new_mount+0x25a/0xa20 fs/namespace.c:3057 path_mount+0x675/0x1010 fs/namespace.c:3387 do_mount fs/namespace.c:3400 [inline] __do_sys_mount fs/namespace.c:3608 [inline] __se_sys_mount+0x318/0x380 fs/namespace.c:3585 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3585 x64_sys_call+0x65d/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:166 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Freed by task 476: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x31/0x50 mm/kasan/generic.c:516 ____kasan_slab_free+0x132/0x180 mm/kasan/common.c:241 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:249 kasan_slab_free include/linux/kasan.h:178 [inline] slab_free_hook mm/slub.c:1745 [inline] slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1771 slab_free mm/slub.c:3686 [inline] __kmem_cache_free+0xb7/0x1b0 mm/slub.c:3702 kfree+0x6f/0xf0 mm/slab_common.c:990 ext4_put_super+0x9b6/0xac0 fs/ext4/super.c:1313 generic_shutdown_super+0x15f/0x370 fs/super.c:503 kill_block_super+0x7f/0xf0 fs/super.c:1472 deactivate_locked_super+0xb5/0x120 fs/super.c:334 deactivate_super+0xaf/0xe0 fs/super.c:365 cleanup_mnt+0x45f/0x4e0 fs/namespace.c:1186 __cleanup_mnt+0x19/0x20 fs/namespace.c:1193 task_work_run+0x1db/0x240 kernel/task_work.c:203 exit_task_work include/linux/task_work.h:39 [inline] do_exit+0xa1d/0x2650 kernel/exit.c:877 do_group_exit+0x210/0x2d0 kernel/exit.c:1027 get_signal+0x13b5/0x1520 kernel/signal.c:2889 arch_do_signal_or_restart+0xb0/0x1030 arch/x86/kernel/signal.c:871 exit_to_user_mode_loop+0x7a/0xb0 kernel/entry/common.c:174 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:210 __syscall_exit_to_user_mode_work kernel/entry/common.c:292 [inline] syscall_exit_to_user_mode+0x1a/0x30 kernel/entry/common.c:303 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:87 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff88813a026000 which belongs to the cache kmalloc-4k of size 4096 The buggy address is located 1216 bytes inside of 4096-byte region [ffff88813a026000, ffff88813a027000) The buggy address belongs to the physical page: page:ffffea0004e80800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x13a020 head:ffffea0004e80800 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100043380 raw: 0000000000000000 0000000000040004 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 420, tgid 414 (syz.0.26), ts 36770291286, free_ts 0 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2637 prep_new_page+0x1c/0x110 mm/page_alloc.c:2644 get_page_from_freelist+0x2c6e/0x2ce0 mm/page_alloc.c:4539 __alloc_pages+0x19e/0x3a0 mm/page_alloc.c:5842 alloc_slab_page+0x6e/0xf0 include/linux/gfp.h:-1 allocate_slab mm/slub.c:1962 [inline] new_slab+0x98/0x3d0 mm/slub.c:2015 ___slab_alloc+0x6f6/0xb50 mm/slub.c:3203 __slab_alloc+0x5e/0xa0 mm/slub.c:3302 slab_alloc_node mm/slub.c:3387 [inline] __kmem_cache_alloc_node+0x203/0x2c0 mm/slub.c:3462 __do_kmalloc_node mm/slab_common.c:937 [inline] __kmalloc_node_track_caller+0xa0/0x1e0 mm/slab_common.c:958 kmalloc_reserve net/core/skbuff.c:446 [inline] pskb_expand_head+0x1b0/0x1210 net/core/skbuff.c:1848 skb_ensure_writable+0x2f8/0x470 net/core/skbuff.c:5785 __bpf_try_make_writable net/core/filter.c:1674 [inline] bpf_try_make_writable net/core/filter.c:1680 [inline] bpf_try_make_head_writable net/core/filter.c:1688 [inline] ____bpf_clone_redirect net/core/filter.c:2457 [inline] bpf_clone_redirect+0x129/0x3c0 net/core/filter.c:2433 0xffffffffa00027ae bpf_dispatcher_nop_func include/linux/bpf.h:987 [inline] __bpf_prog_run include/linux/filter.h:603 [inline] bpf_prog_run include/linux/filter.h:610 [inline] bpf_test_run+0x349/0x8d0 net/bpf/test_run.c:402 bpf_prog_test_run_skb+0xaec/0x1290 net/bpf/test_run.c:1183 page_owner free stack trace missing Memory state around the buggy address: ffff88813a026380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88813a026400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88813a026480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88813a026500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88813a026580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== Quota error (device loop5): write_blk: dquota write failed Quota error (device loop5): qtree_write_dquot: Error -117 occurred while creating quota EXT4-fs error (device loop5): ext4_acquire_dquot:6789: comm syz.5.173: Failed to acquire dquot type 0 EXT4-fs error (device loop5): ext4_free_blocks:6210: comm syz.5.173: Freeing blocks not in datazone - block = 0, count = 4096 EXT4-fs error (device loop5): ext4_read_inode_bitmap:140: comm syz.5.173: Invalid inode bitmap blk 0 in block_group 0 EXT4-fs error (device loop5) in ext4_free_inode:362: Corrupt filesystem EXT4-fs (loop5): 1 orphan inode deleted EXT4-fs (loop5): mounted filesystem without journal. Quota mode: writeback. EXT4-fs (loop5): re-mounted. Quota mode: writeback.