================================================================== BUG: KASAN: use-after-free in instrument_atomic_write include/linux/instrumented.h:97 [inline] BUG: KASAN: use-after-free in clear_bit include/asm-generic/bitops/instrumented-atomic.h:41 [inline] BUG: KASAN: use-after-free in mm_drop_cid kernel/sched/sched.h:3801 [inline] BUG: KASAN: use-after-free in mm_cid_schedout kernel/sched/sched.h:3984 [inline] BUG: KASAN: use-after-free in mm_cid_switch_to kernel/sched/sched.h:3991 [inline] BUG: KASAN: use-after-free in context_switch kernel/sched/core.c:5284 [inline] BUG: KASAN: use-after-free in __schedule+0x3eb9/0x60e0 kernel/sched/core.c:6907 Write of size 8 at addr ffff88805aa63c90 by task syz.0.6048/25228 CPU: 2 UID: 0 PID: 25228 Comm: syz.0.6048 Tainted: G L syzkaller #0 PREEMPT(full) Tainted: [L]=SOFTLOCKUP Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x156/0x4c9 mm/kasan/report.c:482 kasan_report+0xdf/0x1e0 mm/kasan/report.c:595 check_region_inline mm/kasan/generic.c:186 [inline] kasan_check_range+0x10f/0x1e0 mm/kasan/generic.c:200 instrument_atomic_write include/linux/instrumented.h:97 [inline] clear_bit include/asm-generic/bitops/instrumented-atomic.h:41 [inline] mm_drop_cid kernel/sched/sched.h:3801 [inline] mm_cid_schedout kernel/sched/sched.h:3984 [inline] mm_cid_switch_to kernel/sched/sched.h:3991 [inline] context_switch kernel/sched/core.c:5284 [inline] __schedule+0x3eb9/0x60e0 kernel/sched/core.c:6907 preempt_schedule_common+0x42/0xc0 kernel/sched/core.c:7091 preempt_schedule_thunk+0x16/0x30 arch/x86/entry/thunk.S:12 mod_memcg_lruvec_state+0x4e0/0x630 mm/memcontrol.c:766 mod_lruvec_state mm/memcontrol.c:787 [inline] lruvec_stat_mod_folio+0x2ae/0x390 mm/memcontrol.c:807 mod_lruvec_page_state include/linux/vmstat.h:528 [inline] account_kernel_stack.isra.0+0xce/0x1f0 kernel/fork.c:488 exit_task_stack_account+0x49/0x120 kernel/fork.c:501 copy_process+0x1404/0x7a10 kernel/fork.c:2538 create_io_thread+0xc2/0x110 kernel/fork.c:2602 create_worker_cont+0xe5/0x420 io_uring/io-wq.c:852 task_work_run+0x150/0x240 kernel/task_work.c:233 get_signal+0x1bd/0x21e0 kernel/signal.c:2807 arch_do_signal_or_restart+0x91/0x770 arch/x86/kernel/signal.c:337 __exit_to_user_mode_loop kernel/entry/common.c:64 [inline] exit_to_user_mode_loop+0x86/0x4a0 kernel/entry/common.c:98 __exit_to_user_mode_prepare include/linux/irq-entry-common.h:226 [inline] syscall_exit_to_user_mode_prepare include/linux/irq-entry-common.h:256 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:325 [inline] do_int80_emulation+0x4b8/0x6b0 arch/x86/entry/syscall_32.c:175 asm_int80_emulation+0x1a/0x20 arch/x86/include/asm/idtentry.h:621 RIP: 0023:0xf7f14f6c Code: Unable to access opcode bytes at 0xf7f14f42. RSP: 002b:00000000f53d65bc EFLAGS: 00000292 ORIG_RAX: 00000000000000f0 RAX: fffffffffffffe00 RBX: 00000000f73d4f88 RCX: 0000000000000080 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000f73d4f8c RBP: 0000000000000081 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x5b39 pfn:0x5aa63 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: 0000000000005b39 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Movable, gfp_mask 0x140cca(GFP_HIGHUSER_MOVABLE|__GFP_COMP), pid 21564, tgid 21563 (syz.0.5231), ts 669308236645, free_ts 669569856146 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x153/0x170 mm/page_alloc.c:1889 prep_new_page mm/page_alloc.c:1897 [inline] get_page_from_freelist+0x111d/0x3140 mm/page_alloc.c:3962 __alloc_frozen_pages_noprof+0x27c/0x2ba0 mm/page_alloc.c:5250 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2485 folio_alloc_mpol_noprof+0x36/0x340 mm/mempolicy.c:2504 shmem_alloc_folio+0x135/0x160 mm/shmem.c:1930 shmem_alloc_and_add_folio+0x371/0xd40 mm/shmem.c:1972 shmem_get_folio_gfp+0x6ab/0x1900 mm/shmem.c:2567 shmem_get_folio mm/shmem.c:2673 [inline] shmem_write_begin+0x1a4/0x420 mm/shmem.c:3327 generic_perform_write+0x292/0xa40 mm/filemap.c:4314 shmem_file_write_iter+0x10e/0x140 mm/shmem.c:3502 __kernel_write_iter+0x2ac/0x920 fs/read_write.c:621 dump_emit_page fs/coredump.c:1299 [inline] dump_user_range+0x3f9/0xb50 fs/coredump.c:1373 elf_core_dump+0x31b0/0x4250 fs/binfmt_elf.c:2111 coredump_write fs/coredump.c:1050 [inline] do_coredump fs/coredump.c:1127 [inline] vfs_coredump+0x27b4/0x5570 fs/coredump.c:1201 get_signal+0x1f2a/0x21e0 kernel/signal.c:3019 page last free pid 18943 tgid 18943 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1433 [inline] free_unref_folios+0xaea/0x1790 mm/page_alloc.c:3040 folios_put_refs+0x53c/0x840 mm/swap.c:1002 folio_batch_release include/linux/pagevec.h:101 [inline] shmem_undo_range+0x5e5/0x1570 mm/shmem.c:1149 shmem_truncate_range mm/shmem.c:1277 [inline] shmem_evict_inode+0x39e/0xbd0 mm/shmem.c:1407 evict+0x3c2/0xad0 fs/inode.c:846 iput_final fs/inode.c:1966 [inline] iput.part.0+0x605/0xf50 fs/inode.c:2015 iput+0x35/0x40 fs/inode.c:1981 filename_unlinkat+0x466/0x730 fs/namei.c:5544 __do_sys_unlink fs/namei.c:5575 [inline] __se_sys_unlink fs/namei.c:5572 [inline] __ia32_sys_unlink+0x45/0x60 fs/namei.c:5572 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline] __do_fast_syscall_32+0xe3/0x8c0 arch/x86/entry/syscall_32.c:307 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Memory state around the buggy address: ffff88805aa63b80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805aa63c00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88805aa63c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88805aa63d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88805aa63d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================