================================================================== BUG: KASAN: slab-use-after-free in __list_del_entry_valid_or_report+0xb4/0x158 lib/list_debug.c:49 Read of size 8 at addr ff6000002ef9ce88 by task kworker/0:1/9 CPU: 0 UID: 0 PID: 9 Comm: kworker/0:1 Not tainted 6.12.0-rc6-syzkaller-g57f7c7dc78cd #0 Hardware name: riscv-virtio,qemu (DT) Workqueue: events binder_deferred_func Call Trace: [] dump_backtrace+0x2e/0x3c arch/riscv/kernel/stacktrace.c:130 [] show_stack+0x34/0x40 arch/riscv/kernel/stacktrace.c:136 [] __dump_stack lib/dump_stack.c:94 [inline] [] dump_stack_lvl+0x122/0x196 lib/dump_stack.c:120 [] print_address_description mm/kasan/report.c:377 [inline] [] print_report+0x290/0x5a0 mm/kasan/report.c:488 [] kasan_report+0xec/0x118 mm/kasan/report.c:601 [] __asan_report_load8_noabort+0x12/0x1a mm/kasan/report_generic.c:381 [] __list_del_entry_valid_or_report+0xb4/0x158 lib/list_debug.c:49 [] __list_del_entry_valid include/linux/list.h:124 [inline] [] __list_del_entry include/linux/list.h:215 [inline] [] list_del_init include/linux/list.h:287 [inline] [] binder_dequeue_work_head_ilocked drivers/android/binder.c:540 [inline] [] binder_release_work+0xb6/0x47c drivers/android/binder.c:5110 [] binder_deferred_release drivers/android/binder.c:6261 [inline] [] binder_deferred_func+0xd40/0x123e drivers/android/binder.c:6296 [] process_one_work+0x956/0x1dae kernel/workqueue.c:3229 [] process_scheduled_works kernel/workqueue.c:3310 [inline] [] worker_thread+0x5be/0xdc6 kernel/workqueue.c:3391 [] kthread+0x28c/0x3a6 kernel/kthread.c:389 [] ret_from_fork+0xe/0x18 arch/riscv/kernel/entry.S:326 Allocated by task 5209: stack_trace_save+0xa0/0xd2 kernel/stacktrace.c:122 kasan_save_stack+0x3e/0x6a mm/kasan/common.c:47 kasan_save_track+0x16/0x28 mm/kasan/common.c:68 kasan_save_alloc_info+0x30/0x3e mm/kasan/generic.c:565 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0xa0/0xa6 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:257 [inline] __kmalloc_cache_noprof+0x1f4/0x318 mm/slub.c:4295 kmalloc_noprof include/linux/slab.h:878 [inline] kzalloc_noprof include/linux/slab.h:1014 [inline] binder_request_freeze_notification drivers/android/binder.c:3855 [inline] binder_thread_write+0x148e/0x4af6 drivers/android/binder.c:4485 binder_ioctl_write_read drivers/android/binder.c:5387 [inline] binder_ioctl+0x200e/0x727a drivers/android/binder.c:5718 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:907 [inline] __se_sys_ioctl fs/ioctl.c:893 [inline] __riscv_sys_ioctl+0x182/0x1e6 fs/ioctl.c:893 syscall_handler+0x94/0x118 arch/riscv/include/asm/syscall.h:90 do_trap_ecall_u+0x1aa/0x216 arch/riscv/kernel/traps.c:331 _new_vmalloc_restore_context_a0+0xc2/0xce Freed by task 9: stack_trace_save+0xa0/0xd2 kernel/stacktrace.c:122 kasan_save_stack+0x3e/0x6a mm/kasan/common.c:47 kasan_save_track+0x16/0x28 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x5a mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x4e/0x68 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2342 [inline] slab_free mm/slub.c:4579 [inline] kfree+0x13c/0x4ce mm/slub.c:4727 binder_free_ref drivers/android/binder.c:1355 [inline] binder_deferred_release drivers/android/binder.c:6256 [inline] binder_deferred_func+0xcb8/0x123e drivers/android/binder.c:6296 process_one_work+0x956/0x1dae kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x5be/0xdc6 kernel/workqueue.c:3391 kthread+0x28c/0x3a6 kernel/kthread.c:389 ret_from_fork+0xe/0x18 arch/riscv/kernel/entry.S:326 The buggy address belongs to the object at ff6000002ef9ce80 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 8 bytes inside of freed 64-byte region [ff6000002ef9ce80, ff6000002ef9cec0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xaef9c ksm flags: 0xffe000000000000(node=0|zone=0|lastcpupid=0x7ff) page_type: f5(slab) raw: 0ffe000000000000 ff600000114018c0 ff1c0000006a1340 dead000000000003 raw: 0000000000000000 0000000080200020 00000001f5000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x52cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP), pid 1959, tgid 1959 (kworker/u10:5), ts 442396036100, free_ts 442390411400 __set_page_owner+0xa2/0x70c mm/page_owner.c:320 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0xec/0x1e4 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1545 [inline] get_page_from_freelist+0xdaa/0x295a mm/page_alloc.c:3457 __alloc_pages_noprof+0x1e2/0x1e96 mm/page_alloc.c:4733 alloc_pages_mpol_noprof+0xf8/0x48a mm/mempolicy.c:2265 alloc_pages_noprof+0x174/0x2f0 mm/mempolicy.c:2345 alloc_slab_page mm/slub.c:2412 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0x2b6/0x40c mm/slub.c:2631 ___slab_alloc+0xaca/0x114c mm/slub.c:3818 __slab_alloc.constprop.0+0x60/0xb2 mm/slub.c:3908 __slab_alloc_node mm/slub.c:3961 [inline] slab_alloc_node mm/slub.c:4122 [inline] __do_kmalloc_node mm/slub.c:4263 [inline] __kmalloc_node_noprof+0x1f8/0x522 mm/slub.c:4270 kmalloc_node_noprof include/linux/slab.h:905 [inline] __vmalloc_area_node mm/vmalloc.c:3624 [inline] __vmalloc_node_range_noprof+0x36e/0x1450 mm/vmalloc.c:3828 alloc_thread_stack_node kernel/fork.c:315 [inline] dup_task_struct kernel/fork.c:1116 [inline] copy_process+0x3658/0x8e52 kernel/fork.c:2204 kernel_clone+0x11e/0x92c kernel/fork.c:2786 user_mode_thread+0xea/0x11a kernel/fork.c:2864 call_usermodehelper_exec_work kernel/umh.c:172 [inline] call_usermodehelper_exec_work+0xd4/0x1ac kernel/umh.c:158 process_one_work+0x956/0x1dae kernel/workqueue.c:3229 page last free pid 9 tgid 9 stack trace: __reset_page_owner+0x8c/0x400 mm/page_owner.c:297 reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1108 [inline] free_unref_page+0x592/0xf08 mm/page_alloc.c:2638 __free_pages+0x13c/0x1bc mm/page_alloc.c:4820 vfree+0x1b6/0xc88 mm/vmalloc.c:3361 delayed_vfree_work+0x58/0x7a mm/vmalloc.c:3282 process_one_work+0x956/0x1dae kernel/workqueue.c:3229 process_scheduled_works kernel/workqueue.c:3310 [inline] worker_thread+0x5be/0xdc6 kernel/workqueue.c:3391 kthread+0x28c/0x3a6 kernel/kthread.c:389 ret_from_fork+0xe/0x18 arch/riscv/kernel/entry.S:326 Memory state around the buggy address: ff6000002ef9cd80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ff6000002ef9ce00: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc >ff6000002ef9ce80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ff6000002ef9cf00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ff6000002ef9cf80: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ==================================================================