================================================================== BUG: KASAN: use-after-free in __list_del_entry_valid+0x2f/0x120 lib/list_debug.c:46 Read of size 8 at addr ffff88810aa1bc88 by task kworker/1:3/306 CPU: 1 PID: 306 Comm: kworker/1:3 Tainted: G W 5.10.226-syzkaller-00184-g139a6bb26d9d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: events binder_deferred_func Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:452 __asan_report_load8_noabort+0x14/0x20 mm/kasan/report_generic.c:309 __list_del_entry_valid+0x2f/0x120 lib/list_debug.c:46 __list_del_entry include/linux/list.h:132 [inline] list_del_init include/linux/list.h:204 [inline] binder_dequeue_work_head_ilocked drivers/android/binder.c:515 [inline] binder_release_work+0xcd/0x680 drivers/android/binder.c:5126 binder_deferred_release drivers/android/binder.c:6278 [inline] binder_deferred_func+0x1847/0x1bc0 drivers/android/binder.c:6313 process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2301 worker_thread+0xaea/0x1510 kernel/workqueue.c:2447 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Allocated by task 753: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:430 [inline] ____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:509 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:518 kasan_kmalloc include/linux/kasan.h:254 [inline] kmem_cache_alloc_trace+0x18a/0x2e0 mm/slub.c:2974 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] binder_request_freeze_notification drivers/android/binder.c:3867 [inline] binder_thread_write+0x9ce/0x6c70 drivers/android/binder.c:4495 binder_ioctl_write_read+0x216/0x6a80 drivers/android/binder.c:5411 binder_ioctl+0x314/0x1e00 drivers/android/binder.c:5727 vfs_ioctl fs/ioctl.c:48 [inline] __do_sys_ioctl fs/ioctl.c:753 [inline] __se_sys_ioctl+0x114/0x190 fs/ioctl.c:739 __x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:739 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 306: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x121/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1595 [inline] slab_free_freelist_hook+0xc0/0x190 mm/slub.c:1621 slab_free mm/slub.c:3203 [inline] kfree+0xc3/0x270 mm/slub.c:4191 binder_free_ref+0x128/0x260 drivers/android/binder.c:1453 binder_deferred_release drivers/android/binder.c:6273 [inline] binder_deferred_func+0x171c/0x1bc0 drivers/android/binder.c:6313 process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2301 worker_thread+0xaea/0x1510 kernel/workqueue.c:2447 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0x100 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 __call_rcu kernel/rcu/tree.c:2976 [inline] call_rcu+0x135/0x11f0 kernel/rcu/tree.c:3050 __percpu_ref_switch_to_atomic lib/percpu-refcount.c:227 [inline] __percpu_ref_switch_mode+0x342/0x620 lib/percpu-refcount.c:274 percpu_ref_kill_and_confirm+0xa3/0x220 lib/percpu-refcount.c:388 percpu_ref_kill include/linux/percpu-refcount.h:149 [inline] blkg_destroy+0x594/0x5f0 block/blk-cgroup.c:415 blkg_destroy_all block/blk-cgroup.c:433 [inline] blkcg_exit_queue+0xac/0x110 block/blk-cgroup.c:1220 blk_exit_queue block/blk-sysfs.c:752 [inline] blk_release_queue+0x2ba/0x430 block/blk-sysfs.c:805 kobject_cleanup lib/kobject.c:713 [inline] kobject_release lib/kobject.c:744 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x178/0x260 lib/kobject.c:761 blk_put_queue+0x19/0x20 block/blk-core.c:338 scsi_device_dev_release_usercontext+0x58a/0x7d0 drivers/scsi/scsi_sysfs.c:479 execute_in_process_context+0x1b5/0x220 kernel/workqueue.c:3360 scsi_device_dev_release+0xf0/0x100 drivers/scsi/scsi_sysfs.c:518 device_release+0x95/0x1c0 kobject_cleanup lib/kobject.c:713 [inline] kobject_release lib/kobject.c:744 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x178/0x260 lib/kobject.c:761 put_device+0x1f/0x30 drivers/base/core.c:3375 __scsi_remove_device+0x2ed/0x360 drivers/scsi/scsi_sysfs.c:1497 scsi_probe_and_add_lun+0x34c3/0x4260 __scsi_scan_target+0x1fb/0xe80 drivers/scsi/scsi_scan.c:1581 scsi_scan_channel drivers/scsi/scsi_scan.c:1669 [inline] scsi_scan_host_selected+0x334/0x5f0 drivers/scsi/scsi_scan.c:1698 do_scsi_scan_host drivers/scsi/scsi_scan.c:1837 [inline] scsi_scan_host+0x3a8/0x670 drivers/scsi/scsi_scan.c:1867 virtscsi_probe+0x92e/0xbf0 drivers/scsi/virtio_scsi.c:915 virtio_dev_probe+0x87d/0xad0 drivers/virtio/virtio.c:274 really_probe+0x39c/0xaf0 drivers/base/dd.c:558 driver_probe_device+0xfd/0x260 drivers/base/dd.c:752 device_driver_attach+0x188/0x290 drivers/base/dd.c:1035 __driver_attach+0x14f/0x390 drivers/base/dd.c:1124 bus_for_each_dev+0x17b/0x1f0 drivers/base/bus.c:305 driver_attach+0x42/0x50 drivers/base/dd.c:1140 bus_add_driver+0x33f/0x590 drivers/base/bus.c:622 driver_register+0x2e2/0x3e0 drivers/base/driver.c:240 register_virtio_driver+0x97/0xc0 drivers/virtio/virtio.c:325 init+0x66/0xde drivers/scsi/virtio_scsi.c:1009 do_one_initcall+0x189/0x620 init/main.c:1197 do_initcall_level+0x186/0x304 init/main.c:1270 do_initcalls+0x4e/0x8e init/main.c:1286 do_basic_setup+0x88/0x91 init/main.c:1306 kernel_init_freeable+0x2be/0x3f5 init/main.c:1510 kernel_init+0x11/0x280 init/main.c:1397 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 The buggy address belongs to the object at ffff88810aa1bc80 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 8 bytes inside of 64-byte region [ffff88810aa1bc80, ffff88810aa1bcc0) The buggy address belongs to the page: page:ffffea00042a86c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10aa1b flags: 0x4000000000000200(slab) raw: 4000000000000200 ffffea00042a88c0 0000001100000011 ffff888100043800 raw: 0000000000000000 0000000080200020 00000001ffffffff 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 1, ts 2080696577, free_ts 0 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5348 allocate_slab mm/slub.c:1808 [inline] new_slab+0x80/0x400 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x302/0x4b0 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc_trace+0x1bd/0x2e0 mm/slub.c:2972 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] blk_ioprio_init+0x54/0x200 block/blk-ioprio.c:226 blkcg_init_queue+0x191/0x320 block/blk-cgroup.c:1185 blk_alloc_queue+0x49f/0x640 block/blk-core.c:575 blk_mq_init_queue_data block/blk-mq.c:3149 [inline] blk_mq_init_queue+0x36/0xd0 block/blk-mq.c:3168 scsi_mq_alloc_queue+0x42/0x140 drivers/scsi/scsi_lib.c:1900 scsi_alloc_sdev+0x642/0x970 drivers/scsi/scsi_scan.c:284 scsi_probe_and_add_lun+0x1aa/0x4260 drivers/scsi/scsi_scan.c:1098 __scsi_scan_target+0x1fb/0xe80 drivers/scsi/scsi_scan.c:1581 scsi_scan_channel drivers/scsi/scsi_scan.c:1669 [inline] scsi_scan_host_selected+0x334/0x5f0 drivers/scsi/scsi_scan.c:1698 page_owner free stack trace missing Memory state around the buggy address: ffff88810aa1bb80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff88810aa1bc00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88810aa1bc80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88810aa1bd00: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ffff88810aa1bd80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== general protection fault, probably for non-canonical address 0xfb37fc2fa0000026: 0000 [#1] PREEMPT SMP KASAN KASAN: maybe wild-memory-access in range [0xd9c0017d00000130-0xd9c0017d00000137] CPU: 1 PID: 306 Comm: kworker/1:3 Tainted: G B W 5.10.226-syzkaller-00184-g139a6bb26d9d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Workqueue: events binder_deferred_func RIP: 0010:__list_del_entry_valid+0x75/0x120 lib/list_debug.c:59 Code: 1e 48 85 db 74 68 4d 85 ff 74 74 48 ba 00 01 00 00 00 00 ad de 48 39 d3 74 76 48 83 c2 22 49 39 d7 74 7e 4c 89 f8 48 c1 e8 03 <42> 80 3c 20 00 74 08 4c 89 ff e8 1c 97 51 ff 49 8b 17 4c 39 f2 75 RSP: 0018:ffffc90007967c20 EFLAGS: 00010a02 RAX: 1b38002fa0000026 RBX: ffff88810b502d00 RCX: ffffffff8256bf49 RDX: dead000000000122 RSI: 0000000000000286 RDI: ffff88810aa1bc80 RBP: ffffc90007967c40 R08: ffffffff813e2a7b R09: 0000000000000003 R10: fffffbfff0e10e48 R11: dffffc0000000001 R12: dffffc0000000000 R13: ffff88810aa1bc80 R14: ffff88810aa1bc80 R15: d9c0017d00000132 FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 0000000119860000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __list_del_entry include/linux/list.h:132 [inline] list_del_init include/linux/list.h:204 [inline] binder_dequeue_work_head_ilocked drivers/android/binder.c:515 [inline] binder_release_work+0xcd/0x680 drivers/android/binder.c:5126 binder_deferred_release drivers/android/binder.c:6278 [inline] binder_deferred_func+0x1847/0x1bc0 drivers/android/binder.c:6313 process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2301 worker_thread+0xaea/0x1510 kernel/workqueue.c:2447 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Modules linked in: ---[ end trace 3c4a6c173e0b4159 ]--- RIP: 0010:__list_del_entry_valid+0x75/0x120 lib/list_debug.c:59 Code: 1e 48 85 db 74 68 4d 85 ff 74 74 48 ba 00 01 00 00 00 00 ad de 48 39 d3 74 76 48 83 c2 22 49 39 d7 74 7e 4c 89 f8 48 c1 e8 03 <42> 80 3c 20 00 74 08 4c 89 ff e8 1c 97 51 ff 49 8b 17 4c 39 f2 75 RSP: 0018:ffffc90007967c20 EFLAGS: 00010a02 RAX: 1b38002fa0000026 RBX: ffff88810b502d00 RCX: ffffffff8256bf49 RDX: dead000000000122 RSI: 0000000000000286 RDI: ffff88810aa1bc80 RBP: ffffc90007967c40 R08: ffffffff813e2a7b R09: 0000000000000003 R10: fffffbfff0e10e48 R11: dffffc0000000001 R12: dffffc0000000000 R13: ffff88810aa1bc80 R14: ffff88810aa1bc80 R15: d9c0017d00000132 FS: 0000000000000000(0000) GS:ffff8881f7100000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000000 CR3: 0000000119860000 CR4: 00000000003506a0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess), 1 bytes skipped: 0: 48 85 db test %rbx,%rbx 3: 74 68 je 0x6d 5: 4d 85 ff test %r15,%r15 8: 74 74 je 0x7e a: 48 ba 00 01 00 00 00 movabs $0xdead000000000100,%rdx 11: 00 ad de 14: 48 39 d3 cmp %rdx,%rbx 17: 74 76 je 0x8f 19: 48 83 c2 22 add $0x22,%rdx 1d: 49 39 d7 cmp %rdx,%r15 20: 74 7e je 0xa0 22: 4c 89 f8 mov %r15,%rax 25: 48 c1 e8 03 shr $0x3,%rax * 29: 42 80 3c 20 00 cmpb $0x0,(%rax,%r12,1) <-- trapping instruction 2e: 74 08 je 0x38 30: 4c 89 ff mov %r15,%rdi 33: e8 1c 97 51 ff call 0xff519754 38: 49 8b 17 mov (%r15),%rdx 3b: 4c 39 f2 cmp %r14,%rdx 3e: 75 .byte 0x75