================================================================== BUG: KASAN: use-after-free in __list_del_entry_valid+0x2f/0x120 lib/list_debug.c:46 Read of size 8 at addr ffff888115ace188 by task kworker/0:7/6617 CPU: 0 PID: 6617 Comm: kworker/0:7 Tainted: G W 5.10.230-syzkaller-00201-ga359b995b6bb #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 9355: 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 6617: 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 tnode_free net/ipv4/fib_trie.c:495 [inline] replace+0x182/0x420 net/ipv4/fib_trie.c:521 inflate net/ipv4/fib_trie.c:623 [inline] resize+0x1150/0x25c0 net/ipv4/fib_trie.c:868 trie_rebalance net/ipv4/fib_trie.c:1059 [inline] fib_insert_node net/ipv4/fib_trie.c:1103 [inline] fib_insert_alias+0xaab/0xf80 net/ipv4/fib_trie.c:1117 fib_table_insert+0x82c/0x1eb0 net/ipv4/fib_trie.c:1328 fib_magic net/ipv4/fib_frontend.c:1093 [inline] fib_add_ifaddr+0x42c/0x1a40 net/ipv4/fib_frontend.c:1115 fib_inetaddr_event+0x159/0x310 net/ipv4/fib_frontend.c:1431 notifier_call_chain kernel/notifier.c:83 [inline] blocking_notifier_call_chain+0xbb/0x140 kernel/notifier.c:337 __inet_insert_ifa+0x906/0xb50 net/ipv4/devinet.c:568 inet_rtm_newaddr+0x8f5/0x16c0 net/ipv4/devinet.c:968 rtnetlink_rcv_msg+0x955/0xc50 net/core/rtnetlink.c:5607 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2500 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5625 netlink_unicast_kernel net/netlink/af_netlink.c:1322 [inline] netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1348 netlink_sendmsg+0xa46/0xd00 net/netlink/af_netlink.c:1916 sock_sendmsg_nosec net/socket.c:652 [inline] __sock_sendmsg net/socket.c:664 [inline] __sys_sendto+0x545/0x700 net/socket.c:2006 __do_sys_sendto net/socket.c:2018 [inline] __se_sys_sendto net/socket.c:2014 [inline] __x64_sys_sendto+0xe5/0x100 net/socket.c:2014 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff888115ace180 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 8 bytes inside of 64-byte region [ffff888115ace180, ffff888115ace1c0) The buggy address belongs to the page: page:ffffea000456b380 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x115ace flags: 0x4000000000000200(slab) raw: 4000000000000200 0000000000000000 0000001d00000001 ffff888100043800 raw: 0000000000000000 0000000000200020 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 2570, ts 106475358349, free_ts 106299733513 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] call_modprobe kernel/kmod.c:79 [inline] __request_module+0x28c/0x8d0 kernel/kmod.c:170 __rtnl_newlink net/core/rtnetlink.c:3430 [inline] rtnl_newlink+0xab4/0x2000 net/core/rtnetlink.c:3527 rtnetlink_rcv_msg+0x955/0xc50 net/core/rtnetlink.c:5607 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2500 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5625 netlink_unicast_kernel net/netlink/af_netlink.c:1322 [inline] netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1348 netlink_sendmsg+0xa46/0xd00 net/netlink/af_netlink.c:1916 sock_sendmsg_nosec net/socket.c:652 [inline] __sock_sendmsg net/socket.c:664 [inline] __sys_sendto+0x545/0x700 net/socket.c:2006 __do_sys_sendto net/socket.c:2018 [inline] __se_sys_sendto net/socket.c:2014 [inline] __x64_sys_sendto+0xe5/0x100 net/socket.c:2014 page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] free_pcp_prepare mm/page_alloc.c:1421 [inline] free_unref_page_prepare+0x2ae/0x2d0 mm/page_alloc.c:3336 free_unref_page mm/page_alloc.c:3391 [inline] free_the_page+0x9e/0x370 mm/page_alloc.c:5407 __free_pages+0x67/0xc0 mm/page_alloc.c:5418 free_pages+0x7c/0x90 mm/page_alloc.c:5429 kasan_depopulate_vmalloc_pte+0x6a/0x90 mm/kasan/shadow.c:354 apply_to_pte_range mm/memory.c:2504 [inline] apply_to_pmd_range mm/memory.c:2540 [inline] apply_to_pud_range mm/memory.c:2568 [inline] apply_to_p4d_range mm/memory.c:2596 [inline] __apply_to_page_range+0x720/0x9e0 mm/memory.c:2623 apply_to_existing_page_range+0x38/0x50 mm/memory.c:2874 kasan_release_vmalloc+0x9a/0xb0 mm/kasan/shadow.c:464 __purge_vmap_area_lazy+0x150e/0x1620 mm/vmalloc.c:1376 _vm_unmap_aliases+0x334/0x3b0 mm/vmalloc.c:1773 vm_remove_mappings mm/vmalloc.c:2261 [inline] __vunmap+0x617/0x8f0 mm/vmalloc.c:2292 __vfree mm/vmalloc.c:2349 [inline] vfree+0x5c/0x80 mm/vmalloc.c:2380 module_memfree+0x17/0x30 kernel/module.c:2205 bpf_jit_free_exec+0x15/0x20 kernel/bpf/core.c:866 bpf_jit_binary_free+0x4e/0x2b0 kernel/bpf/core.c:915 bpf_jit_free+0x7c/0x1e0 kernel/bpf/core.c:928 Memory state around the buggy address: ffff888115ace080: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888115ace100: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff888115ace180: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff888115ace200: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888115ace280: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ================================================================== general protection fault, probably for non-canonical address 0xfc83fc584000033b: 0000 [#1] PREEMPT SMP KASAN KASAN: maybe wild-memory-access in range [0xe42002c2000019d8-0xe42002c2000019df] CPU: 0 PID: 6617 Comm: kworker/0:7 Tainted: G B W 5.10.230-syzkaller-00201-ga359b995b6bb #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 8c 91 51 ff 49 8b 17 4c 39 f2 75 RSP: 0018:ffffc9000137fc20 EFLAGS: 00010a02 RAX: 1c8400584000033b RBX: ffff888116d6a700 RCX: ffffffff8256ca09 RDX: dead000000000122 RSI: 0000000000000286 RDI: ffff888115ace180 RBP: ffffc9000137fc40 R08: ffffffff813e2a9b R09: 0000000000000003 R10: fffffbfff0e11248 R11: dffffc0000000001 R12: dffffc0000000000 R13: ffff888115ace180 R14: ffff888115ace180 R15: e42002c2000019d9 FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020fe9008 CR3: 000000010dcab000 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: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 8138e365d5d65428 ]--- 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 8c 91 51 ff 49 8b 17 4c 39 f2 75 RSP: 0018:ffffc9000137fc20 EFLAGS: 00010a02 RAX: 1c8400584000033b RBX: ffff888116d6a700 RCX: ffffffff8256ca09 RDX: dead000000000122 RSI: 0000000000000286 RDI: ffff888115ace180 RBP: ffffc9000137fc40 R08: ffffffff813e2a9b R09: 0000000000000003 R10: fffffbfff0e11248 R11: dffffc0000000001 R12: dffffc0000000000 R13: ffff888115ace180 R14: ffff888115ace180 R15: e42002c2000019d9 FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000020fe9008 CR3: 000000010dcab000 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 8c 91 51 ff call 0xff5191c4 38: 49 8b 17 mov (%r15),%rdx 3b: 4c 39 f2 cmp %r14,%rdx 3e: 75 .byte 0x75