usb 2-1: USB disconnect, device number 7 ================================================================== 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 ff60000012aeb988 by task kworker/1:1/32 CPU: 1 UID: 0 PID: 32 Comm: kworker/1: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 4682: 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 32: 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 ff60000012aeb980 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 8 bytes inside of freed 64-byte region [ff60000012aeb980, ff60000012aeb9c0) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x92aeb flags: 0xffe000000000000(node=0|zone=0|lastcpupid=0x7ff) page_type: f5(slab) raw: 0ffe000000000000 ff600000114018c0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000200020 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 0x252800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_THISNODE), pid 1, tgid 1 (swapper/0), ts 1321564000, free_ts 0 __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_node_noprof include/linux/gfp.h:269 [inline] alloc_slab_page mm/slub.c:2414 [inline] allocate_slab mm/slub.c:2578 [inline] new_slab+0xae/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 fork_idle+0x154/0x336 kernel/fork.c:2705 idle_init kernel/smpboot.c:55 [inline] idle_threads_init+0x156/0x332 kernel/smpboot.c:74 smp_init+0x22/0x176 kernel/smp.c:1004 kernel_init_freeable+0x480/0x792 init/main.c:1572 kernel_init+0x28/0x226 init/main.c:1469 ret_from_fork+0xe/0x18 arch/riscv/kernel/entry.S:326 page_owner free stack trace missing Memory state around the buggy address: ff60000012aeb880: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ff60000012aeb900: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc >ff60000012aeb980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ff60000012aeba00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ff60000012aeba80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================