================================================================== BUG: KASAN: use-after-free in radix_tree_next_slot include/linux/radix-tree.h:421 [inline] BUG: KASAN: use-after-free in idr_for_each+0x206/0x220 lib/idr.c:202 Read of size 8 at addr ffff88802214a6b8 by task kworker/u4:2/26 CPU: 0 PID: 26 Comm: kworker/u4:2 Not tainted 5.9.0-rc2-next-20200828-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events_unbound io_ring_exit_work Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x18f/0x20d lib/dump_stack.c:118 print_address_description.constprop.0.cold+0xae/0x497 mm/kasan/report.c:383 __kasan_report mm/kasan/report.c:513 [inline] kasan_report.cold+0x1f/0x37 mm/kasan/report.c:530 radix_tree_next_slot include/linux/radix-tree.h:421 [inline] idr_for_each+0x206/0x220 lib/idr.c:202 io_destroy_buffers fs/io_uring.c:7846 [inline] io_ring_ctx_free fs/io_uring.c:7861 [inline] io_ring_exit_work+0x363/0x6d0 fs/io_uring.c:7936 process_one_work+0x94c/0x1670 kernel/workqueue.c:2269 worker_thread+0x64c/0x1120 kernel/workqueue.c:2415 kthread+0x3b5/0x4a0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Allocated by task 25318: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xbf/0xd0 mm/kasan/common.c:461 slab_post_alloc_hook mm/slab.h:517 [inline] slab_alloc mm/slab.c:3312 [inline] kmem_cache_alloc+0x138/0x3a0 mm/slab.c:3482 radix_tree_node_alloc.constprop.0+0x7c/0x320 lib/radix-tree.c:275 idr_get_free+0x4b0/0x8e0 lib/radix-tree.c:1505 idr_alloc_u32+0x170/0x2d0 lib/idr.c:46 idr_alloc+0xc2/0x130 lib/idr.c:87 io_provide_buffers fs/io_uring.c:3736 [inline] io_issue_sqe+0x4cf5/0x6250 fs/io_uring.c:5854 __io_queue_sqe+0x280/0x1180 fs/io_uring.c:6126 io_queue_sqe+0x692/0xfa0 fs/io_uring.c:6205 io_submit_sqe fs/io_uring.c:6275 [inline] io_submit_sqes+0x1794/0x2380 fs/io_uring.c:6472 __do_sys_io_uring_enter+0xdc7/0x1ae0 fs/io_uring.c:8256 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 25331: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0xd8/0x120 mm/kasan/common.c:422 __cache_free mm/slab.c:3418 [inline] kmem_cache_free.part.0+0x67/0x1f0 mm/slab.c:3693 rcu_do_batch kernel/rcu/tree.c:2474 [inline] rcu_core+0x61e/0x1220 kernel/rcu/tree.c:2709 __do_softirq+0x2de/0xa24 kernel/softirq.c:298 Last call_rcu(): kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_record_aux_stack+0x82/0xb0 mm/kasan/generic.c:346 __call_rcu kernel/rcu/tree.c:2951 [inline] call_rcu+0x14f/0x7f0 kernel/rcu/tree.c:3025 radix_tree_node_free lib/radix-tree.c:309 [inline] delete_node+0x587/0x8a0 lib/radix-tree.c:572 __radix_tree_delete+0x190/0x370 lib/radix-tree.c:1378 radix_tree_delete_item+0xe7/0x230 lib/radix-tree.c:1429 __io_remove_buffers fs/io_uring.c:3634 [inline] __io_remove_buffers fs/io_uring.c:3613 [inline] __io_destroy_buffers+0x161/0x200 fs/io_uring.c:7840 idr_for_each+0x113/0x220 lib/idr.c:208 io_destroy_buffers fs/io_uring.c:7846 [inline] io_ring_ctx_free fs/io_uring.c:7861 [inline] io_ring_exit_work+0x363/0x6d0 fs/io_uring.c:7936 process_one_work+0x94c/0x1670 kernel/workqueue.c:2269 worker_thread+0x64c/0x1120 kernel/workqueue.c:2415 kthread+0x3b5/0x4a0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:294 Second to last call_rcu(): kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_record_aux_stack+0x82/0xb0 mm/kasan/generic.c:346 __call_rcu kernel/rcu/tree.c:2951 [inline] call_rcu+0x14f/0x7f0 kernel/rcu/tree.c:3025 radix_tree_node_free lib/radix-tree.c:309 [inline] delete_node+0xe5/0x8a0 lib/radix-tree.c:572 __radix_tree_delete+0x190/0x370 lib/radix-tree.c:1378 radix_tree_delete_item+0xe7/0x230 lib/radix-tree.c:1429 free_pid+0x9b/0x260 kernel/pid.c:151 __change_pid+0x1d2/0x2d0 kernel/pid.c:352 __unhash_process kernel/exit.c:77 [inline] __exit_signal kernel/exit.c:147 [inline] release_task+0xd29/0x14d0 kernel/exit.c:198 wait_task_zombie kernel/exit.c:1088 [inline] wait_consider_task+0x2fb3/0x3b20 kernel/exit.c:1315 do_wait_thread kernel/exit.c:1378 [inline] do_wait+0x36a/0x9e0 kernel/exit.c:1449 kernel_wait4+0x14c/0x260 kernel/exit.c:1604 __do_sys_wait4+0x13f/0x150 kernel/exit.c:1632 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88802214a680 which belongs to the cache radix_tree_node of size 576 The buggy address is located 56 bytes inside of 576-byte region [ffff88802214a680, ffff88802214a8c0) The buggy address belongs to the page: page:00000000fd80b1d9 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802214affb pfn:0x2214a flags: 0xfffe0000000200(slab) raw: 00fffe0000000200 ffffea0000884e48 ffffea00021b0488 ffff8880aa06f000 raw: ffff88802214affb ffff88802214a100 0000000100000005 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88802214a580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802214a600: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88802214a680: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802214a700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802214a780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================