================================================================== BUG: KASAN: use-after-free in radix_tree_next_slot include/linux/radix-tree.h:422 [inline] BUG: KASAN: use-after-free in idr_for_each+0x1a8/0x1c4 lib/idr.c:202 Read of size 8 at addr ffff0000292f90b8 by task syz-executor.0/11029 CPU: 1 PID: 11029 Comm: syz-executor.0 Not tainted 5.11.0-rc7-syzkaller-00090-gdcc0b49040c7 #0 Hardware name: linux,dummy-virt (DT) Call trace: dump_backtrace+0x0/0x3e0 arch/arm64/include/asm/pointer_auth.h:76 show_stack+0x18/0x70 arch/arm64/kernel/stacktrace.c:196 __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x110/0x188 lib/dump_stack.c:120 print_address_description.constprop.0+0x2c/0x300 mm/kasan/report.c:230 __kasan_report mm/kasan/report.c:396 [inline] kasan_report+0x1e8/0x200 mm/kasan/report.c:413 __asan_report_load8_noabort+0x34/0x60 mm/kasan/report_generic.c:309 radix_tree_next_slot include/linux/radix-tree.h:422 [inline] idr_for_each+0x1a8/0x1c4 lib/idr.c:202 io_ring_ctx_wait_and_kill+0x16c/0x4d0 fs/io_uring.c:8798 io_uring_release+0x34/0x54 fs/io_uring.c:8823 __fput+0x1a0/0x6b0 fs/file_table.c:280 ____fput+0x10/0x20 fs/file_table.c:313 task_work_run+0xd4/0x20c kernel/task_work.c:140 exit_task_work include/linux/task_work.h:30 [inline] do_exit+0x940/0x2330 kernel/exit.c:825 do_group_exit+0xcc/0x23c kernel/exit.c:922 get_signal+0x354/0x1924 kernel/signal.c:2773 do_signal arch/arm64/kernel/signal.c:882 [inline] do_notify_resume+0x2b8/0x25fc arch/arm64/kernel/signal.c:936 work_pending+0xc/0x35c Allocated by task 11029: stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:121 kasan_save_stack+0x28/0x5c mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:401 [inline] ____kasan_kmalloc.constprop.0+0x8c/0xb4 mm/kasan/common.c:429 __kasan_slab_alloc+0x18/0x2c mm/kasan/common.c:437 kasan_slab_alloc include/linux/kasan.h:209 [inline] slab_post_alloc_hook mm/slab.h:512 [inline] slab_alloc_node mm/slub.c:2892 [inline] slab_alloc mm/slub.c:2900 [inline] kmem_cache_alloc+0x1cc/0x5c4 mm/slub.c:2905 radix_tree_node_alloc.constprop.0+0xec/0x3a0 lib/radix-tree.c:274 idr_get_free+0x2e8/0x910 lib/radix-tree.c:1504 idr_alloc_u32+0x120/0x280 lib/idr.c:46 idr_alloc_cyclic+0xe8/0x1b4 lib/idr.c:125 io_register_personality fs/io_uring.c:9870 [inline] __io_uring_register fs/io_uring.c:10099 [inline] __do_sys_io_uring_register fs/io_uring.c:10149 [inline] __se_sys_io_uring_register fs/io_uring.c:10131 [inline] __arm64_sys_io_uring_register+0x780/0x3de0 fs/io_uring.c:10131 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall arch/arm64/kernel/syscall.c:49 [inline] el0_svc_common.constprop.0+0x110/0x3c0 arch/arm64/kernel/syscall.c:159 do_el0_svc_compat+0x40/0x80 arch/arm64/kernel/syscall.c:204 el0_svc_compat+0x20/0x30 arch/arm64/kernel/entry-common.c:442 el0_sync_compat_handler+0x90/0x140 arch/arm64/kernel/entry-common.c:451 el0_sync_compat+0x178/0x180 arch/arm64/kernel/entry.S:708 Freed by task 11030: stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:121 kasan_save_stack+0x28/0x5c mm/kasan/common.c:38 kasan_set_track+0x28/0x40 mm/kasan/common.c:46 kasan_set_free_info+0x28/0x50 mm/kasan/generic.c:356 ____kasan_slab_free+0xf0/0x154 mm/kasan/common.c:362 __kasan_slab_free+0x14/0x20 mm/kasan/common.c:369 kasan_slab_free include/linux/kasan.h:192 [inline] slab_free_hook mm/slub.c:1547 [inline] slab_free_freelist_hook+0x8c/0x240 mm/slub.c:1580 slab_free mm/slub.c:3143 [inline] kmem_cache_free+0xc4/0x5ac mm/slub.c:3159 radix_tree_node_rcu_free+0x78/0xb0 lib/radix-tree.c:302 rcu_do_batch kernel/rcu/tree.c:2489 [inline] rcu_core+0x860/0xe10 kernel/rcu/tree.c:2723 rcu_core_si+0x10/0x1c kernel/rcu/tree.c:2736 _stext+0x400/0x10cc Last potentially related work creation: stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:121 kasan_save_stack+0x28/0x5c mm/kasan/common.c:38 kasan_record_aux_stack+0xf8/0x130 mm/kasan/generic.c:344 __call_rcu kernel/rcu/tree.c:2965 [inline] call_rcu+0xf4/0x5f0 kernel/rcu/tree.c:3038 radix_tree_node_free lib/radix-tree.c:308 [inline] delete_node+0x300/0x510 lib/radix-tree.c:571 __radix_tree_delete+0x134/0x3dc lib/radix-tree.c:1377 radix_tree_delete_item+0xbc/0x1bc lib/radix-tree.c:1428 idr_remove+0x4c/0x6c lib/idr.c:154 io_remove_personalities+0x18/0x154 fs/io_uring.c:8743 idr_for_each+0xec/0x1c4 lib/idr.c:208 io_ring_ctx_wait_and_kill+0x16c/0x4d0 fs/io_uring.c:8798 io_uring_release+0x34/0x54 fs/io_uring.c:8823 __fput+0x1a0/0x6b0 fs/file_table.c:280 ____fput+0x10/0x20 fs/file_table.c:313 task_work_run+0xd4/0x20c kernel/task_work.c:140 exit_task_work include/linux/task_work.h:30 [inline] do_exit+0x940/0x2330 kernel/exit.c:825 do_group_exit+0xcc/0x23c kernel/exit.c:922 get_signal+0x354/0x1924 kernel/signal.c:2773 do_signal arch/arm64/kernel/signal.c:882 [inline] do_notify_resume+0x2b8/0x25fc arch/arm64/kernel/signal.c:936 work_pending+0xc/0x35c Second to last potentially related work creation: stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:121 kasan_save_stack+0x28/0x5c mm/kasan/common.c:38 kasan_record_aux_stack+0xf8/0x130 mm/kasan/generic.c:344 __call_rcu kernel/rcu/tree.c:2965 [inline] call_rcu+0xf4/0x5f0 kernel/rcu/tree.c:3038 radix_tree_node_free lib/radix-tree.c:308 [inline] delete_node+0xd8/0x510 lib/radix-tree.c:571 __radix_tree_delete+0x134/0x3dc lib/radix-tree.c:1377 radix_tree_delete_item+0xbc/0x1bc lib/radix-tree.c:1428 idr_remove+0x4c/0x6c lib/idr.c:154 free_pid+0x8c/0x210 kernel/pid.c:152 __change_pid+0x188/0x280 kernel/pid.c:353 detach_pid+0x14/0x20 kernel/pid.c:358 __unhash_process kernel/exit.c:78 [inline] __exit_signal kernel/exit.c:148 [inline] release_task+0xa80/0x12a0 kernel/exit.c:199 wait_task_zombie kernel/exit.c:1107 [inline] wait_consider_task+0x21f0/0x3180 kernel/exit.c:1334 do_wait_thread kernel/exit.c:1397 [inline] do_wait+0x2b4/0x894 kernel/exit.c:1468 kernel_wait4+0xe4/0x270 kernel/exit.c:1630 __do_compat_sys_wait4+0xf4/0x104 kernel/exit.c:1688 __se_compat_sys_wait4 kernel/exit.c:1681 [inline] __arm64_compat_sys_wait4+0x88/0xd0 kernel/exit.c:1681 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall arch/arm64/kernel/syscall.c:49 [inline] el0_svc_common.constprop.0+0x110/0x3c0 arch/arm64/kernel/syscall.c:159 do_el0_svc_compat+0x40/0x80 arch/arm64/kernel/syscall.c:204 el0_svc_compat+0x20/0x30 arch/arm64/kernel/entry-common.c:442 el0_sync_compat_handler+0x90/0x140 arch/arm64/kernel/entry-common.c:451 el0_sync_compat+0x178/0x180 arch/arm64/kernel/entry.S:708 The buggy address belongs to the object at ffff0000292f9080 which belongs to the cache radix_tree_node of size 576 The buggy address is located 56 bytes inside of 576-byte region [ffff0000292f9080, ffff0000292f92c0) The buggy address belongs to the page: page:0000000019495863 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x692f8 head:0000000019495863 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x1ffc00000010200(slab|head) raw: 01ffc00000010200 fffffc000069d300 0000000200000002 ffff00000cc0c900 raw: 0000000000000000 0000000080170017 00000001ffffffff ffff000028852001 page dumped because: kasan: bad access detected pages's memcg:ffff000028852001 Memory state around the buggy address: ffff0000292f8f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000292f9000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff0000292f9080: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000292f9100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000292f9180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================