================================================================== 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 ffff000034043cb8 by task syz-executor.0/21503 CPU: 0 PID: 21503 Comm: syz-executor.0 Not tainted 5.11.0-syzkaller-10867-g29c395c77a9a #0 Hardware name: linux,dummy-virt (DT) Call trace: ptrauth_strip_insn_pac arch/arm64/include/asm/pointer_auth.h:76 [inline] dump_backtrace+0x0/0x3e0 arch/arm64/kernel/stacktrace.c:109 show_stack+0x18/0x70 arch/arm64/kernel/stacktrace.c:191 __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:397 [inline] kasan_report+0x1e8/0x200 mm/kasan/report.c:414 __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+0xdc/0x304 fs/io_uring.c:8868 io_uring_release+0x34/0x5c fs/io_uring.c:8895 __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/0x22e0 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 21503: 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:400 [inline] ____kasan_kmalloc.constprop.0+0x8c/0xb4 mm/kasan/common.c:428 __kasan_slab_alloc+0x18/0x2c mm/kasan/common.c:436 kasan_slab_alloc include/linux/kasan.h:208 [inline] slab_post_alloc_hook mm/slab.h:516 [inline] slab_alloc_node mm/slub.c:2895 [inline] slab_alloc mm/slub.c:2903 [inline] kmem_cache_alloc+0x1bc/0x570 mm/slub.c:2908 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:9936 [inline] __io_uring_register fs/io_uring.c:10150 [inline] __do_sys_io_uring_register fs/io_uring.c:10200 [inline] __se_sys_io_uring_register fs/io_uring.c:10182 [inline] __arm64_sys_io_uring_register+0x790/0x3c80 fs/io_uring.c:10182 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall arch/arm64/kernel/syscall.c:49 [inline] el0_svc_common.constprop.0+0xf0/0x2c0 arch/arm64/kernel/syscall.c:129 do_el0_svc+0xa4/0xd0 arch/arm64/kernel/syscall.c:168 el0_svc+0x24/0x34 arch/arm64/kernel/entry-common.c:416 el0_sync_handler+0x1a4/0x1b0 arch/arm64/kernel/entry-common.c:432 el0_sync+0x170/0x180 arch/arm64/kernel/entry.S:699 Freed by task 7391: 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:361 __kasan_slab_free+0x14/0x20 mm/kasan/common.c:368 kasan_slab_free include/linux/kasan.h:191 [inline] slab_free_hook mm/slub.c:1561 [inline] slab_free_freelist_hook+0x8c/0x240 mm/slub.c:1594 slab_free mm/slub.c:3146 [inline] kmem_cache_free+0xc4/0x56c mm/slub.c:3162 radix_tree_node_rcu_free+0x78/0xb0 lib/radix-tree.c:302 rcu_do_batch kernel/rcu/tree.c:2559 [inline] rcu_core+0xb8c/0x1880 kernel/rcu/tree.c:2794 rcu_core_si+0x10/0x20 kernel/rcu/tree.c:2807 _stext+0x2b4/0x1084 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:3039 [inline] call_rcu+0xb4/0x8d0 kernel/rcu/tree.c:3114 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_unregister_personality+0x1c/0x190 fs/io_uring.c:8813 io_remove_personalities+0x18/0x30 fs/io_uring.c:8828 idr_for_each+0xec/0x1c4 lib/idr.c:208 io_ring_ctx_wait_and_kill+0xdc/0x304 fs/io_uring.c:8868 io_uring_release+0x34/0x5c fs/io_uring.c:8895 __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/0x22e0 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:3039 [inline] call_rcu+0xb4/0x8d0 kernel/rcu/tree.c:3114 radix_tree_node_free lib/radix-tree.c:308 [inline] radix_tree_shrink lib/radix-tree.c:534 [inline] delete_node+0x2c8/0x510 lib/radix-tree.c:552 __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+0x2ac/0x840 kernel/exit.c:1468 kernel_wait4+0xe4/0x270 kernel/exit.c:1630 __do_sys_wait4+0xfc/0x1f0 kernel/exit.c:1658 __se_sys_wait4 kernel/exit.c:1654 [inline] __arm64_sys_wait4+0x88/0xd0 kernel/exit.c:1654 __invoke_syscall arch/arm64/kernel/syscall.c:37 [inline] invoke_syscall arch/arm64/kernel/syscall.c:49 [inline] el0_svc_common.constprop.0+0xf0/0x2c0 arch/arm64/kernel/syscall.c:129 do_el0_svc+0xa4/0xd0 arch/arm64/kernel/syscall.c:168 el0_svc+0x24/0x34 arch/arm64/kernel/entry-common.c:416 el0_sync_handler+0x1a4/0x1b0 arch/arm64/kernel/entry-common.c:432 el0_sync+0x170/0x180 arch/arm64/kernel/entry.S:699 The buggy address belongs to the object at ffff000034043c80 which belongs to the cache radix_tree_node of size 576 The buggy address is located 56 bytes inside of 576-byte region [ffff000034043c80, ffff000034043ec0) The buggy address belongs to the page: page:000000009931f7d8 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x74040 head:000000009931f7d8 order:2 compound_mapcount:0 compound_pincount:0 memcg:ffff00000e0d5c01 flags: 0x1ffc00000010200(slab|head) raw: 01ffc00000010200 0000000000000000 0000000100000001 ffff00000cc0c900 raw: 0000000000000000 0000000000170017 00000001ffffffff ffff00000e0d5c01 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff000034043b80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff000034043c00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff000034043c80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff000034043d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff000034043d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================