================================================================== 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 ffff0000356c5378 by task syz-executor.0/21072 CPU: 0 PID: 21072 Comm: syz-executor.0 Not tainted 5.12.0-rc2-syzkaller-00059-g144c79ef3353 #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:191 __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x120/0x1a8 lib/dump_stack.c:120 print_address_description.constprop.0+0x2c/0x300 mm/kasan/report.c:232 __kasan_report mm/kasan/report.c:399 [inline] kasan_report+0x1ec/0x200 mm/kasan/report.c:416 __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+0xac/0x250 fs/io_uring.c:8550 io_uring_release+0x34/0x54 fs/io_uring.c:8574 __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+0x900/0x2290 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 21072: stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:121 kasan_save_stack+0x28/0x60 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:427 [inline] __kasan_slab_alloc+0x60/0x84 mm/kasan/common.c:460 kasan_slab_alloc include/linux/kasan.h:223 [inline] slab_post_alloc_hook mm/slab.h:516 [inline] slab_alloc_node mm/slub.c:2907 [inline] slab_alloc mm/slub.c:2915 [inline] kmem_cache_alloc+0x1cc/0x594 mm/slub.c:2920 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:9539 [inline] __io_uring_register fs/io_uring.c:9749 [inline] __do_sys_io_uring_register fs/io_uring.c:9801 [inline] __se_sys_io_uring_register fs/io_uring.c:9781 [inline] __arm64_sys_io_uring_register+0x7bc/0x3e20 fs/io_uring.c:9781 __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 4582: stack_trace_save+0x9c/0xe0 kernel/stacktrace.c:121 kasan_save_stack+0x28/0x60 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:357 ____kasan_slab_free mm/kasan/common.c:360 [inline] ____kasan_slab_free+0xfc/0x160 mm/kasan/common.c:325 __kasan_slab_free+0x14/0x20 mm/kasan/common.c:367 kasan_slab_free include/linux/kasan.h:199 [inline] slab_free_hook mm/slub.c:1562 [inline] slab_free_freelist_hook+0x8c/0x260 mm/slub.c:1600 slab_free mm/slub.c:3161 [inline] kmem_cache_free+0xc4/0x70c mm/slub.c:3177 radix_tree_node_rcu_free+0x78/0xb0 lib/radix-tree.c:302 rcu_do_batch kernel/rcu/tree.c:2559 [inline] rcu_core+0xb78/0x1794 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/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xf8/0x130 mm/kasan/generic.c:345 __call_rcu kernel/rcu/tree.c:3039 [inline] call_rcu+0xb4/0x8b0 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 fs/io_uring.c:8486 [inline] io_remove_personalities+0x18/0xb0 fs/io_uring.c:8499 idr_for_each+0xec/0x1c4 lib/idr.c:208 io_ring_ctx_wait_and_kill+0xac/0x250 fs/io_uring.c:8550 io_uring_release+0x34/0x54 fs/io_uring.c:8574 __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+0x900/0x2290 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/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xf8/0x130 mm/kasan/generic.c:345 __call_rcu kernel/rcu/tree.c:3039 [inline] call_rcu+0xb4/0x8b0 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 ffff0000356c5340 which belongs to the cache radix_tree_node of size 576 The buggy address is located 56 bytes inside of 576-byte region [ffff0000356c5340, ffff0000356c5580) The buggy address belongs to the page: page:00000000fe978e49 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x756c4 head:00000000fe978e49 order:2 compound_mapcount:0 compound_pincount:0 memcg:ffff00000e318201 flags: 0x1ffc00000010200(slab|head) raw: 01ffc00000010200 0000000000000000 0000001300000001 ffff00000c80c900 raw: 0000000000000000 0000000000170017 00000001ffffffff ffff00000e318201 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000356c5200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000356c5280: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff0000356c5300: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ^ ffff0000356c5380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000356c5400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================