================================================================== BUG: KASAN: use-after-free in __list_del_entry_valid+0x2f/0x120 lib/list_debug.c:46 Read of size 8 at addr ffff88810aa74888 by task kworker/0:4/387 CPU: 0 PID: 387 Comm: kworker/0:4 Tainted: G W 5.15.169-syzkaller-00123-g9efd694ed939 #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:88 [inline] dump_stack_lvl+0x151/0x1c0 lib/dump_stack.c:106 print_address_description+0x87/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:444 __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:5183 binder_deferred_release drivers/android/binder.c:6339 [inline] binder_deferred_func+0x1847/0x1bc0 drivers/android/binder.c:6374 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Allocated by task 2792: 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:433 [inline] ____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:512 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521 kasan_kmalloc include/linux/kasan.h:227 [inline] kmem_cache_alloc_trace+0x115/0x210 mm/slub.c:3267 kmalloc include/linux/slab.h:603 [inline] kzalloc include/linux/slab.h:733 [inline] binder_request_freeze_notification drivers/android/binder.c:3895 [inline] binder_thread_write+0x9f5/0x6ec0 drivers/android/binder.c:4535 binder_ioctl_write_read+0x205/0x7300 drivers/android/binder.c:5470 binder_ioctl+0x371/0x2640 drivers/android/binder.c:5787 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:874 [inline] __se_sys_ioctl+0x114/0x190 fs/ioctl.c:860 __x64_sys_ioctl+0x7b/0x90 fs/ioctl.c:860 x64_sys_call+0x98/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:17 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 387: 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+0x126/0x160 mm/kasan/common.c:365 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:193 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1749 slab_free mm/slub.c:3519 [inline] kfree+0xc8/0x220 mm/slub.c:4579 binder_free_ref+0x128/0x260 drivers/android/binder.c:1465 binder_deferred_release drivers/android/binder.c:6334 [inline] binder_deferred_func+0x171c/0x1bc0 drivers/android/binder.c:6374 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 kvfree_call_rcu+0xb1/0x8b0 kernel/rcu/tree.c:3644 fib_notifier_ops_unregister+0xe7/0x100 net/core/fib_notifier.c:167 fib6_notifier_exit+0x3b/0x40 net/ipv6/fib6_notifier.c:63 fib6_net_exit+0x305/0x320 net/ipv6/ip6_fib.c:2442 ops_exit_list net/core/net_namespace.c:172 [inline] cleanup_net+0x64b/0xc00 net/core/net_namespace.c:599 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 __call_rcu_common kernel/rcu/tree.c:3007 [inline] call_rcu+0x123/0x10b0 kernel/rcu/tree.c:3125 call_rcu_hurry include/linux/rcupdate.h:89 [inline] __percpu_ref_switch_to_atomic lib/percpu-refcount.c:233 [inline] __percpu_ref_switch_mode+0x342/0x620 lib/percpu-refcount.c:281 percpu_ref_kill_and_confirm+0xa3/0x220 lib/percpu-refcount.c:395 percpu_ref_kill include/linux/percpu-refcount.h:149 [inline] blkg_destroy+0x594/0x5f0 block/blk-cgroup.c:415 blkg_destroy_all+0xd2/0x440 block/blk-cgroup.c:436 blkcg_exit_queue+0x15/0x20 block/blk-cgroup.c:1245 blk_exit_queue block/blk-sysfs.c:774 [inline] blk_release_queue+0x148/0x270 block/blk-sysfs.c:810 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:347 scsi_device_dev_release_usercontext+0x58e/0x840 drivers/scsi/scsi_sysfs.c:478 execute_in_process_context+0x1af/0x240 kernel/workqueue.c:3393 scsi_device_dev_release+0xf8/0x110 drivers/scsi/scsi_sysfs.c:519 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:3533 __scsi_remove_device+0x307/0x370 drivers/scsi/scsi_sysfs.c:1506 scsi_probe_and_add_lun+0x2360/0x4320 __scsi_scan_target+0x1ed/0xe30 drivers/scsi/scsi_scan.c:1637 scsi_scan_channel drivers/scsi/scsi_scan.c:1725 [inline] scsi_scan_host_selected+0x334/0x5f0 drivers/scsi/scsi_scan.c:1754 do_scsi_scan_host drivers/scsi/scsi_scan.c:1893 [inline] scsi_scan_host+0x3a8/0x670 drivers/scsi/scsi_scan.c:1923 virtscsi_probe+0x930/0xc30 drivers/scsi/virtio_scsi.c:915 virtio_dev_probe+0x891/0xae0 drivers/virtio/virtio.c:273 really_probe+0x28d/0x970 drivers/base/dd.c:595 __driver_probe_device+0x1a0/0x310 drivers/base/dd.c:755 driver_probe_device+0x54/0x3d0 drivers/base/dd.c:785 __driver_attach+0x446/0x590 drivers/base/dd.c:1164 bus_for_each_dev+0x17b/0x1f0 drivers/base/bus.c:303 driver_attach+0x42/0x50 drivers/base/dd.c:1181 bus_add_driver+0x33f/0x590 drivers/base/bus.c:620 driver_register+0x2e2/0x3e0 drivers/base/driver.c:240 register_virtio_driver+0x97/0xc0 drivers/virtio/virtio.c:325 init+0x66/0xe0 drivers/scsi/virtio_scsi.c:1009 do_one_initcall+0x182/0x610 init/main.c:1302 do_initcall_level+0x186/0x310 init/main.c:1375 do_initcalls+0x4e/0x90 init/main.c:1391 do_basic_setup+0x81/0x90 init/main.c:1410 kernel_init_freeable+0x2c1/0x400 init/main.c:1615 kernel_init+0x1d/0x290 init/main.c:1506 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 The buggy address belongs to the object at ffff88810aa74880 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 8 bytes inside of 64-byte region [ffff88810aa74880, ffff88810aa748c0) The buggy address belongs to the page: page:ffffea00042a9d00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10aa74 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 dead000000000100 dead000000000122 ffff888100042780 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 4641186569, free_ts 0 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1b/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5779 allocate_slab mm/slub.c:1932 [inline] new_slab+0x9a/0x4e0 mm/slub.c:1995 ___slab_alloc+0x39e/0x830 mm/slub.c:3028 __slab_alloc+0x4a/0x90 mm/slub.c:3115 slab_alloc_node mm/slub.c:3206 [inline] slab_alloc mm/slub.c:3248 [inline] kmem_cache_alloc_trace+0x142/0x210 mm/slub.c:3265 kmalloc include/linux/slab.h:603 [inline] kzalloc include/linux/slab.h:733 [inline] percpu_ref_init+0xc8/0x340 lib/percpu-refcount.c:76 blkg_alloc+0xa7/0x5b0 block/blk-cgroup.c:162 blkcg_init_queue+0x29/0x200 block/blk-cgroup.c:1190 blk_alloc_queue+0x3fa/0x570 block/blk-core.c:593 blk_mq_init_queue_data block/blk-mq.c:3156 [inline] blk_mq_init_queue+0x36/0xd0 block/blk-mq.c:3170 scsi_alloc_sdev+0x674/0xa10 drivers/scsi/scsi_scan.c:319 scsi_probe_and_add_lun+0x199/0x4320 drivers/scsi/scsi_scan.c:1156 __scsi_scan_target+0x1ed/0xe30 drivers/scsi/scsi_scan.c:1637 page_owner free stack trace missing Memory state around the buggy address: ffff88810aa74780: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88810aa74800: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88810aa74880: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88810aa74900: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88810aa74980: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== general protection fault, probably for non-canonical address 0xfad3fc4b80000030: 0000 [#1] PREEMPT SMP KASAN KASAN: maybe wild-memory-access in range [0xd6a0025c00000180-0xd6a0025c00000187] CPU: 0 PID: 387 Comm: kworker/0:4 Tainted: G B W 5.15.169-syzkaller-00123-g9efd694ed939 #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 fc 7e 48 ff 49 8b 17 4c 39 f2 75 RSP: 0018:ffffc90000c47c00 EFLAGS: 00010a06 RAX: 1ad4004b80000030 RBX: ffff88811230fd00 RCX: ffffffff826a3f89 RDX: dead000000000122 RSI: 0000000000000282 RDI: ffff88810aa74880 RBP: ffffc90000c47c20 R08: ffffffff8141a43b R09: 0000000000000003 R10: fffffbfff0e9a84c R11: dffffc0000000001 R12: dffffc0000000000 R13: ffff88810aa74880 R14: ffff88810aa74880 R15: d6a0025c00000183 FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b3011bff8 CR3: 0000000130f12000 CR4: 00000000003506b0 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:5183 binder_deferred_release drivers/android/binder.c:6339 [inline] binder_deferred_func+0x1847/0x1bc0 drivers/android/binder.c:6374 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Modules linked in: ---[ end trace 86221b3de4f6fdec ]--- 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 fc 7e 48 ff 49 8b 17 4c 39 f2 75 RSP: 0018:ffffc90000c47c00 EFLAGS: 00010a06 RAX: 1ad4004b80000030 RBX: ffff88811230fd00 RCX: ffffffff826a3f89 RDX: dead000000000122 RSI: 0000000000000282 RDI: ffff88810aa74880 RBP: ffffc90000c47c20 R08: ffffffff8141a43b R09: 0000000000000003 R10: fffffbfff0e9a84c R11: dffffc0000000001 R12: dffffc0000000000 R13: ffff88810aa74880 R14: ffff88810aa74880 R15: d6a0025c00000183 FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b3011bff8 CR3: 0000000006a0f000 CR4: 00000000003506b0 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 fc 7e 48 ff call 0xff487f34 38: 49 8b 17 mov (%r15),%rdx 3b: 4c 39 f2 cmp %r14,%rdx 3e: 75 .byte 0x75