================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_write include/linux/instrumented.h:82 [inline] BUG: KASAN: slab-use-after-free in clear_bit include/asm-generic/bitops/instrumented-atomic.h:41 [inline] BUG: KASAN: slab-use-after-free in mm_drop_cid kernel/sched/sched.h:3746 [inline] BUG: KASAN: slab-use-after-free in mm_cid_schedout kernel/sched/sched.h:3927 [inline] BUG: KASAN: slab-use-after-free in mm_cid_switch_to kernel/sched/sched.h:3934 [inline] BUG: KASAN: slab-use-after-free in context_switch kernel/sched/core.c:5249 [inline] BUG: KASAN: slab-use-after-free in __schedule+0x3ca9/0x5fa0 kernel/sched/core.c:6867 Write of size 8 at addr ffff888028b3b050 by task syz.2.1972/15773 CPU: 1 UID: 0 PID: 15773 Comm: syz.2.1972 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/0x1a0 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:82 [inline] clear_bit include/asm-generic/bitops/instrumented-atomic.h:41 [inline] mm_drop_cid kernel/sched/sched.h:3746 [inline] mm_cid_schedout kernel/sched/sched.h:3927 [inline] mm_cid_switch_to kernel/sched/sched.h:3934 [inline] context_switch kernel/sched/core.c:5249 [inline] __schedule+0x3ca9/0x5fa0 kernel/sched/core.c:6867 preempt_schedule_irq+0x50/0x90 kernel/sched/core.c:7194 irqentry_exit+0x17b/0x670 kernel/entry/common.c:216 asm_sysvec_reschedule_ipi+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 RIP: 0010:bpf_tree_comp kernel/bpf/core.c:614 [inline] RIP: 0010:__lt_find include/linux/rbtree_latch.h:115 [inline] RIP: 0010:latch_tree_find include/linux/rbtree_latch.h:210 [inline] RIP: 0010:bpf_ksym_find+0x9d/0x1c0 kernel/bpf/core.c:712 Code: de e8 87 77 f0 ff 4a 8d 2c 33 48 8d bd e0 fd ff ff 48 89 f8 48 c1 e8 03 42 80 3c 28 00 0f 85 f1 00 00 00 4c 8b bd e0 fd ff ff <4c> 89 e7 4c 89 fe e8 78 71 f0 ff 4d 39 fc 0f 82 b9 00 00 00 e8 4a RSP: 0000:ffffc9000782f410 EFLAGS: 00000246 RAX: 1ffff1100aceb041 RBX: ffff888056758428 RCX: ffffc9000ded2000 RDX: 0000000000080000 RSI: ffffffff8215d8d9 RDI: ffff888056758208 RBP: ffff888056758428 R08: 0000000000000006 R09: 00000000f73cd579 R10: ffffffffa0206800 R11: 0000000000000000 R12: 00000000f73cd579 R13: dffffc0000000000 R14: 0000000000000000 R15: ffffffffa02019d0 is_bpf_text_address+0x58/0x1a0 kernel/bpf/core.c:745 kernel_text_address kernel/extable.c:125 [inline] kernel_text_address+0x8d/0x100 kernel/extable.c:94 __kernel_text_address+0xd/0x30 kernel/extable.c:79 unwind_get_return_address+0x59/0xa0 arch/x86/kernel/unwind_orc.c:385 arch_stack_walk+0xa6/0xf0 arch/x86/kernel/stacktrace.c:26 stack_trace_save+0x8e/0xc0 kernel/stacktrace.c:122 kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_record_aux_stack+0xa7/0xc0 mm/kasan/generic.c:556 __call_rcu_common.constprop.0+0xa5/0x9b0 kernel/rcu/tree.c:3131 delayed_free_task kernel/fork.c:1915 [inline] copy_process+0x1420/0x7770 kernel/fork.c:2534 create_io_thread+0xc2/0x110 kernel/fork.c:2596 create_worker_cont+0xe5/0x420 io_uring/io-wq.c:846 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:41 [inline] exit_to_user_mode_loop+0x86/0x4b0 kernel/entry/common.c:75 __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_work include/linux/entry-common.h:159 [inline] syscall_exit_to_user_mode include/linux/entry-common.h:194 [inline] __do_fast_syscall_32+0x4b6/0x660 arch/x86/entry/syscall_32.c:310 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:332 entry_SYSENTER_compat_after_hwframe+0x84/0x8e RIP: 0023:0xf73cd579 Code: Unable to access opcode bytes at 0xf73cd54f. RSP: 002b:00000000f53b450c EFLAGS: 00000292 ORIG_RAX: 00000000000001aa RAX: 0000000000000800 RBX: 0000000000000007 RCX: 0000000000003516 RDX: 000000000000addf RSI: 0000000000000002 RDI: 0000000000000000 RBP: 000000000001517f R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 Allocated by task 15730: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 unpoison_slab_object mm/kasan/common.c:340 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:366 kasan_slab_alloc include/linux/kasan.h:253 [inline] slab_post_alloc_hook mm/slub.c:4953 [inline] slab_alloc_node mm/slub.c:5263 [inline] kmem_cache_alloc_noprof+0x2ad/0x780 mm/slub.c:5270 alloc_empty_file+0x55/0x1c0 fs/file_table.c:237 path_openat+0xe8/0x31a0 fs/namei.c:4781 do_filp_open+0x1f7/0x420 fs/namei.c:4822 do_sys_openat2+0x12e/0x220 fs/open.c:1391 do_sys_open fs/open.c:1397 [inline] __do_sys_openat fs/open.c:1413 [inline] __se_sys_openat fs/open.c:1408 [inline] __x64_sys_openat+0x12d/0x210 fs/open.c:1408 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xc9/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 15732: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_save_track+0x14/0x30 mm/kasan/common.c:78 kasan_save_free_info+0x3b/0x70 mm/kasan/generic.c:584 poison_slab_object mm/kasan/common.c:253 [inline] __kasan_slab_free+0x5f/0x80 mm/kasan/common.c:285 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:2540 [inline] slab_free_after_rcu_debug+0xe5/0x1c0 mm/slub.c:6737 rcu_do_batch kernel/rcu/tree.c:2617 [inline] rcu_core+0x5a2/0x10d0 kernel/rcu/tree.c:2869 handle_softirqs+0x1ea/0x910 kernel/softirq.c:622 __do_softirq kernel/softirq.c:656 [inline] invoke_softirq kernel/softirq.c:496 [inline] __irq_exit_rcu+0xef/0x150 kernel/softirq.c:723 irq_exit_rcu+0x9/0x30 kernel/softirq.c:739 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1056 [inline] sysvec_apic_timer_interrupt+0xa3/0xc0 arch/x86/kernel/apic/apic.c:1056 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:697 Last potentially related work creation: kasan_save_stack+0x30/0x50 mm/kasan/common.c:57 kasan_record_aux_stack+0xa7/0xc0 mm/kasan/generic.c:556 slab_free_hook mm/slub.c:2501 [inline] slab_free mm/slub.c:6674 [inline] kmem_cache_free+0x478/0x720 mm/slub.c:6789 file_free fs/file_table.c:79 [inline] __fput_deferred+0x3e6/0x490 fs/file_table.c:524 fput_close+0x118/0x250 fs/file_table.c:586 path_openat+0xfec/0x31a0 fs/namei.c:4804 do_filp_open+0x1f7/0x420 fs/namei.c:4822 do_sys_openat2+0x12e/0x220 fs/open.c:1391 do_sys_open fs/open.c:1397 [inline] __do_sys_openat fs/open.c:1413 [inline] __se_sys_openat fs/open.c:1408 [inline] __x64_sys_openat+0x12d/0x210 fs/open.c:1408 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xc9/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888028b3afc0 which belongs to the cache filp of size 360 The buggy address is located 144 bytes inside of freed 360-byte region [ffff888028b3afc0, ffff888028b3b128) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0xffff888028b3ac40 pfn:0x28b3a head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888029b0c201 flags: 0xfff00000000240(workingset|head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000240 ffff88801cec3540 ffffea0000922e10 ffffea000092f390 raw: ffff888028b3ac40 0000000000120009 00000000f5000000 ffff888029b0c201 head: 00fff00000000240 ffff88801cec3540 ffffea0000922e10 ffffea000092f390 head: ffff888028b3ac40 0000000000120009 00000000f5000000 ffff888029b0c201 head: 00fff00000000001 ffffea0000a2ce81 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000002 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 2105, tgid 2105 (kworker/u32:0), ts 18152964075, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1e1/0x250 mm/page_alloc.c:1884 prep_new_page mm/page_alloc.c:1892 [inline] get_page_from_freelist+0xe3d/0x2e10 mm/page_alloc.c:3945 __alloc_frozen_pages_noprof+0x26c/0x2410 mm/page_alloc.c:5240 alloc_pages_mpol+0x1fb/0x550 mm/mempolicy.c:2486 alloc_slab_page mm/slub.c:3075 [inline] allocate_slab mm/slub.c:3248 [inline] new_slab+0x2c4/0x440 mm/slub.c:3302 ___slab_alloc+0xda3/0x1ca0 mm/slub.c:4656 __slab_alloc.isra.0+0x63/0x110 mm/slub.c:4779 __slab_alloc_node mm/slub.c:4855 [inline] slab_alloc_node mm/slub.c:5251 [inline] kmem_cache_alloc_noprof+0x4ec/0x780 mm/slub.c:5270 alloc_empty_file+0x55/0x1c0 fs/file_table.c:237 path_openat+0xe8/0x31a0 fs/namei.c:4781 do_filp_open+0x1f7/0x420 fs/namei.c:4822 do_open_execat+0xf6/0x3a0 fs/exec.c:783 alloc_bprm+0x2d/0x710 fs/exec.c:1409 kernel_execve+0xb0/0x3d0 fs/exec.c:1884 call_usermodehelper_exec_async+0x239/0x4b0 kernel/umh.c:109 ret_from_fork+0x754/0xaf0 arch/x86/kernel/process.c:158 page_owner free stack trace missing Memory state around the buggy address: ffff888028b3af00: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ffff888028b3af80: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb >ffff888028b3b000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888028b3b080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888028b3b100: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc ================================================================== ---------------- Code disassembly (best guess): 0: de e8 fsubrp %st,%st(0) 2: 87 77 f0 xchg %esi,-0x10(%rdi) 5: ff 4a 8d decl -0x73(%rdx) 8: 2c 33 sub $0x33,%al a: 48 8d bd e0 fd ff ff lea -0x220(%rbp),%rdi 11: 48 89 f8 mov %rdi,%rax 14: 48 c1 e8 03 shr $0x3,%rax 18: 42 80 3c 28 00 cmpb $0x0,(%rax,%r13,1) 1d: 0f 85 f1 00 00 00 jne 0x114 23: 4c 8b bd e0 fd ff ff mov -0x220(%rbp),%r15 * 2a: 4c 89 e7 mov %r12,%rdi <-- trapping instruction 2d: 4c 89 fe mov %r15,%rsi 30: e8 78 71 f0 ff call 0xfff071ad 35: 4d 39 fc cmp %r15,%r12 38: 0f 82 b9 00 00 00 jb 0xf7 3e: e8 .byte 0xe8 3f: 4a rex.WX