cgroup: fork rejected by pids controller in /syz3 ================================================================== 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 ffff8880485ac8d0 by task syz.3.7177/26189 CPU: 2 UID: 0 PID: 26189 Comm: syz.3.7177 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 __raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:179 [inline] _raw_spin_unlock_irqrestore+0x61/0x80 kernel/locking/spinlock.c:194 io_worker_release+0x54/0x80 io_uring/io-wq.c:173 task_work_run+0x150/0x240 kernel/task_work.c:233 get_signal+0x1bd/0x21e0 kernel/signal.c:2807 arch_do_signal_or_restart+0x91/0x7a0 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_syscall_64+0x67c/0xf80 arch/x86/entry/syscall_64.c:100 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7ff55a19c629 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ff55afbf028 EFLAGS: 00000246 ORIG_RAX: 00000000000001aa RAX: 0000000000000400 RBX: 00007ff55a415fa0 RCX: 00007ff55a19c629 RDX: 0000000000000000 RSI: 00000000000047ba RDI: 0000000000000003 RBP: 00007ff55a232b39 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ff55a416038 R14: 00007ff55a415fa0 R15: 00007ffde23eeb78 The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x1db5 pfn:0x485ac flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 dead000000000100 dead000000000122 0000000000000000 raw: 0000000000001db5 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0xcc0(GFP_KERNEL), pid 21184, tgid 21182 (syz.3.5487), ts 377575625872, free_ts 381187572153 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_noprof mm/page_alloc.c:5284 [inline] alloc_pages_bulk_noprof+0x782/0x1490 mm/page_alloc.c:5204 ___alloc_pages_bulk mm/kasan/shadow.c:345 [inline] __kasan_populate_vmalloc_do mm/kasan/shadow.c:370 [inline] __kasan_populate_vmalloc+0xf0/0x210 mm/kasan/shadow.c:424 kasan_populate_vmalloc include/linux/kasan.h:580 [inline] alloc_vmap_area+0x95d/0x2bd0 mm/vmalloc.c:2129 __get_vm_area_node+0x1ca/0x330 mm/vmalloc.c:3232 get_vm_area+0x73/0xa0 mm/vmalloc.c:3274 arena_map_alloc+0x29d/0x850 kernel/bpf/arena.c:206 map_create+0x84e/0x2ba0 kernel/bpf/syscall.c:1507 __sys_bpf+0x2091/0x4b90 kernel/bpf/syscall.c:6210 __do_sys_bpf kernel/bpf/syscall.c:6341 [inline] __se_sys_bpf kernel/bpf/syscall.c:6339 [inline] __x64_sys_bpf+0x7b/0xc0 kernel/bpf/syscall.c:6339 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x106/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f page last free pid 6011 tgid 6011 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] __free_pages_prepare mm/page_alloc.c:1433 [inline] __free_frozen_pages+0x7e1/0x10d0 mm/page_alloc.c:2978 kasan_depopulate_vmalloc_pte+0x5d/0x80 mm/kasan/shadow.c:484 apply_to_pte_range mm/memory.c:3243 [inline] apply_to_pmd_range mm/memory.c:3287 [inline] apply_to_pud_range mm/memory.c:3323 [inline] apply_to_p4d_range mm/memory.c:3359 [inline] __apply_to_page_range+0xb1d/0x1520 mm/memory.c:3395 __kasan_release_vmalloc+0xd7/0xe0 mm/kasan/shadow.c:602 kasan_release_vmalloc include/linux/kasan.h:593 [inline] kasan_release_vmalloc_node mm/vmalloc.c:2290 [inline] purge_vmap_node+0x210/0xb40 mm/vmalloc.c:2312 __purge_vmap_area_lazy+0x935/0xc20 mm/vmalloc.c:2402 drain_vmap_area_work+0x27/0x40 mm/vmalloc.c:2436 process_one_work+0x9d7/0x1920 kernel/workqueue.c:3275 process_scheduled_works kernel/workqueue.c:3358 [inline] worker_thread+0x5da/0xe40 kernel/workqueue.c:3439 kthread+0x370/0x450 kernel/kthread.c:467 ret_from_fork+0x754/0xd80 arch/x86/kernel/process.c:158 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 Memory state around the buggy address: ffff8880485ac780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880485ac800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8880485ac880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8880485ac900: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8880485ac980: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================