gfs2: fsid=syz:syz.0: H: s:UN f: e:0 p:0 [(ended)] work_exited+0x0/0x20 gfs2: fsid=syz:syz.0: H: s:UN f: e:0 p:0 [(ended)] work_exited+0x0/0x20 gfs2: fsid=syz:syz.0: H: s:UN f: e:0 p:0 [(ended)] work_exited+0x0/0x20 ================================================================== BUG: KASAN: slab-use-after-free in gfs2_dump_glock+0x15b1/0x1bb0 Read of size 8 at addr ffff888028cbe338 by task syz.0.288/6407 CPU: 1 UID: 0 PID: 6407 Comm: syz.0.288 Not tainted 6.11.0-rc4-next-20240820-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 gfs2_dump_glock+0x15b1/0x1bb0 gfs2_consist_inode_i+0xf5/0x110 fs/gfs2/util.c:457 gfs2_dirent_scan+0x52b/0x670 gfs2_dirent_search+0x30e/0x8c0 fs/gfs2/dir.c:853 gfs2_dir_search+0xb2/0x2f0 fs/gfs2/dir.c:1653 gfs2_lookupi+0x461/0x5e0 fs/gfs2/inode.c:340 __gfs2_lookup+0xa4/0x280 fs/gfs2/inode.c:896 gfs2_atomic_open+0x9e/0x230 fs/gfs2/inode.c:1297 atomic_open fs/namei.c:3455 [inline] lookup_open fs/namei.c:3566 [inline] open_last_lookups fs/namei.c:3694 [inline] path_openat+0x101e/0x3590 fs/namei.c:3930 do_filp_open+0x235/0x490 fs/namei.c:3960 do_sys_openat2+0x13e/0x1d0 fs/open.c:1416 do_sys_open fs/open.c:1431 [inline] __do_sys_open fs/open.c:1439 [inline] __se_sys_open fs/open.c:1435 [inline] __x64_sys_open+0x225/0x270 fs/open.c:1435 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f6733979e79 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 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f6734691038 EFLAGS: 00000246 ORIG_RAX: 0000000000000002 RAX: ffffffffffffffda RBX: 00007f6733b16058 RCX: 00007f6733979e79 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000020000100 RBP: 00007f67339e7916 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f6733b16058 R15: 00007ffdbf58f3a8 Allocated by task 6373: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4036 [inline] slab_alloc_node mm/slub.c:4085 [inline] kmem_cache_alloc_node_noprof+0x16b/0x320 mm/slub.c:4128 alloc_task_struct_node kernel/fork.c:180 [inline] dup_task_struct+0x57/0x8c0 kernel/fork.c:1107 copy_process+0x5d1/0x3d50 kernel/fork.c:2206 kernel_clone+0x226/0x8f0 kernel/fork.c:2787 __do_sys_clone3 kernel/fork.c:3091 [inline] __se_sys_clone3+0x2cb/0x350 kernel/fork.c:3070 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 16: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2299 [inline] slab_free mm/slub.c:4521 [inline] kmem_cache_free+0x195/0x3d0 mm/slub.c:4623 put_task_struct include/linux/sched/task.h:139 [inline] delayed_put_task_struct+0x125/0x300 kernel/exit.c:228 rcu_do_batch kernel/rcu/tree.c:2567 [inline] rcu_core+0xaaa/0x17a0 kernel/rcu/tree.c:2823 handle_softirqs+0x2c5/0x980 kernel/softirq.c:554 run_ksoftirqd+0xca/0x130 kernel/softirq.c:927 smpboot_thread_fn+0x544/0xa30 kernel/smpboot.c:164 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:541 __call_rcu_common kernel/rcu/tree.c:3086 [inline] call_rcu+0x167/0xa70 kernel/rcu/tree.c:3190 context_switch kernel/sched/core.c:5314 [inline] __schedule+0x1852/0x4b30 kernel/sched/core.c:6677 preempt_schedule_common+0x84/0xd0 kernel/sched/core.c:6856 preempt_schedule+0xe1/0xf0 kernel/sched/core.c:6880 preempt_schedule_thunk+0x1a/0x30 arch/x86/entry/thunk.S:12 on_each_cpu_cond_mask+0x79/0x80 kernel/smp.c:1052 on_each_cpu include/linux/smp.h:71 [inline] text_poke_sync arch/x86/kernel/alternative.c:2085 [inline] text_poke_bp_batch+0x352/0xb30 arch/x86/kernel/alternative.c:2295 text_poke_flush arch/x86/kernel/alternative.c:2486 [inline] text_poke_finish+0x30/0x50 arch/x86/kernel/alternative.c:2493 arch_jump_label_transform_apply+0x1c/0x30 arch/x86/kernel/jump_label.c:146 static_key_enable_cpuslocked+0x136/0x260 kernel/jump_label.c:210 static_key_enable+0x1a/0x20 kernel/jump_label.c:223 toggle_allocation_gate+0xbc/0x260 mm/kfence/core.c:849 process_one_work kernel/workqueue.c:3232 [inline] process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3313 worker_thread+0x86d/0xd10 kernel/workqueue.c:3390 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Second to last potentially related work creation: kasan_save_stack+0x3f/0x60 mm/kasan/common.c:47 __kasan_record_aux_stack+0xac/0xc0 mm/kasan/generic.c:541 task_work_add+0xb8/0x450 kernel/task_work.c:66 task_tick_mm_cid kernel/sched/core.c:10422 [inline] sched_tick+0x322/0x610 kernel/sched/core.c:5594 update_process_times+0x202/0x230 kernel/time/timer.c:2492 tick_sched_handle kernel/time/tick-sched.c:276 [inline] tick_nohz_handler+0x37c/0x500 kernel/time/tick-sched.c:297 __run_hrtimer kernel/time/hrtimer.c:1691 [inline] __hrtimer_run_queues+0x551/0xd50 kernel/time/hrtimer.c:1755 hrtimer_interrupt+0x396/0x990 kernel/time/hrtimer.c:1817 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1026 [inline] __sysvec_apic_timer_interrupt+0x110/0x3f0 arch/x86/kernel/apic/apic.c:1043 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1037 [inline] sysvec_apic_timer_interrupt+0xa1/0xc0 arch/x86/kernel/apic/apic.c:1037 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 The buggy address belongs to the object at ffff888028cbda00 which belongs to the cache task_struct of size 7424 The buggy address is located 2360 bytes inside of freed 7424-byte region [ffff888028cbda00, ffff888028cbf700) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x28cb8 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888025479cc1 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xfdffffff(slab) raw: 00fff00000000040 ffff8880166fb500 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000040004 00000001fdffffff ffff888025479cc1 head: 00fff00000000040 ffff8880166fb500 dead000000000100 dead000000000122 head: 0000000000000000 0000000000040004 00000001fdffffff ffff888025479cc1 head: 00fff00000000003 ffffea0000a32e01 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 2, tgid 2 (kthreadd), ts 9382428181, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1517 prep_new_page mm/page_alloc.c:1525 [inline] get_page_from_freelist+0x3004/0x30c0 mm/page_alloc.c:3476 __alloc_pages_noprof+0x29e/0x780 mm/page_alloc.c:4743 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2368 allocate_slab+0x5a/0x2f0 mm/slub.c:2531 new_slab mm/slub.c:2584 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3771 __slab_alloc+0x58/0xa0 mm/slub.c:3861 __slab_alloc_node mm/slub.c:3914 [inline] slab_alloc_node mm/slub.c:4073 [inline] kmem_cache_alloc_node_noprof+0x1fe/0x320 mm/slub.c:4128 alloc_task_struct_node kernel/fork.c:180 [inline] dup_task_struct+0x57/0x8c0 kernel/fork.c:1107 copy_process+0x5d1/0x3d50 kernel/fork.c:2206 kernel_clone+0x226/0x8f0 kernel/fork.c:2787 kernel_thread+0x1bc/0x240 kernel/fork.c:2849 create_kthread kernel/kthread.c:412 [inline] kthreadd+0x60d/0x810 kernel/kthread.c:765 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 page_owner free stack trace missing Memory state around the buggy address: ffff888028cbe200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888028cbe280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888028cbe300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888028cbe380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888028cbe400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================