================================================================== BUG: KASAN: slab-use-after-free in __list_del_entry_valid_or_report+0x2f/0x140 lib/list_debug.c:49 Read of size 8 at addr ffff888028d34e08 by task kworker/0:0/8 CPU: 0 UID: 0 PID: 8 Comm: kworker/0:0 Not tainted 6.12.0-rc1-syzkaller-00031-ge32cde8d2bd7 #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:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 __list_del_entry_valid_or_report+0x2f/0x140 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+0xc7/0x480 drivers/android/binder.c:5110 binder_deferred_release drivers/android/binder.c:6261 [inline] binder_deferred_func+0x1275/0x1460 drivers/android/binder.c:6296 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3310 worker_thread+0x870/0xd30 kernel/workqueue.c:3391 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 6114: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:257 [inline] __kmalloc_cache_noprof+0x19c/0x2c0 mm/slub.c:4296 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 drivers/android/binder.c:4485 [inline] binder_ioctl_write_read+0xe7f/0xb560 drivers/android/binder.c:5387 binder_ioctl+0x436/0x1cc0 drivers/android/binder.c:5718 __do_compat_sys_ioctl fs/ioctl.c:1007 [inline] __se_compat_sys_ioctl+0x510/0xc90 fs/ioctl.c:950 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0xb4/0x110 arch/x86/entry/common.c:386 do_fast_syscall_32+0x34/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Freed by task 8: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:579 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:2343 [inline] slab_free mm/slub.c:4580 [inline] kfree+0x1a0/0x440 mm/slub.c:4728 binder_free_ref drivers/android/binder.c:1355 [inline] binder_deferred_release drivers/android/binder.c:6256 [inline] binder_deferred_func+0x11df/0x1460 drivers/android/binder.c:6296 process_one_work kernel/workqueue.c:3229 [inline] process_scheduled_works+0xa63/0x1850 kernel/workqueue.c:3310 worker_thread+0x870/0xd30 kernel/workqueue.c:3391 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff888028d34e00 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 8 bytes inside of freed 64-byte region [ffff888028d34e00, ffff888028d34e40) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x28d34 anon flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801ac418c0 ffffea00013d1140 dead000000000005 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 5250, tgid 5250 (syz-executor), ts 80073073028, free_ts 80072824942 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1537 prep_new_page mm/page_alloc.c:1545 [inline] get_page_from_freelist+0x3045/0x3190 mm/page_alloc.c:3457 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4733 alloc_pages_mpol_noprof+0x3e8/0x680 mm/mempolicy.c:2265 alloc_slab_page+0x6a/0x120 mm/slub.c:2413 allocate_slab+0x5a/0x2f0 mm/slub.c:2579 new_slab mm/slub.c:2632 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3819 __slab_alloc+0x58/0xa0 mm/slub.c:3909 __slab_alloc_node mm/slub.c:3962 [inline] slab_alloc_node mm/slub.c:4123 [inline] __kmalloc_cache_node_noprof+0x20c/0x300 mm/slub.c:4304 kmalloc_node_noprof include/linux/slab.h:901 [inline] __get_vm_area_node+0x113/0x270 mm/vmalloc.c:3106 __vmalloc_node_range_noprof+0x3a6/0x13f0 mm/vmalloc.c:3788 __vmalloc_node_noprof mm/vmalloc.c:3893 [inline] vzalloc_noprof+0x79/0x90 mm/vmalloc.c:3966 alloc_counters+0xd7/0x740 net/ipv4/netfilter/ip_tables.c:799 compat_copy_entries_to_user+0xa5/0x620 net/ipv4/netfilter/ip_tables.c:1561 compat_get_entries net/ipv4/netfilter/ip_tables.c:1604 [inline] do_ipt_get_ctl+0xe4d/0x1810 net/ipv4/netfilter/ip_tables.c:1665 nf_getsockopt+0x299/0x2c0 net/netfilter/nf_sockopt.c:116 page last free pid 5250 tgid 5250 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1108 [inline] free_unref_page+0xcfb/0xf20 mm/page_alloc.c:2638 vfree+0x186/0x2e0 mm/vmalloc.c:3361 compat_copy_entries_to_user+0x550/0x620 net/ipv4/netfilter/ip_tables.c:1574 compat_get_entries net/ipv4/netfilter/ip_tables.c:1604 [inline] do_ipt_get_ctl+0xe4d/0x1810 net/ipv4/netfilter/ip_tables.c:1665 nf_getsockopt+0x299/0x2c0 net/netfilter/nf_sockopt.c:116 ip_getsockopt+0x222/0x2e0 net/ipv4/ip_sockglue.c:1777 tcp_getsockopt+0x163/0x1c0 net/ipv4/tcp.c:4670 do_sock_getsockopt+0x3c4/0x7e0 net/socket.c:2391 __sys_getsockopt+0x267/0x330 net/socket.c:2420 __do_compat_sys_socketcall net/compat.c:494 [inline] __se_compat_sys_socketcall+0x349/0x1430 net/compat.c:423 do_syscall_32_irqs_on arch/x86/entry/common.c:165 [inline] __do_fast_syscall_32+0xb4/0x110 arch/x86/entry/common.c:386 do_fast_syscall_32+0x34/0x80 arch/x86/entry/common.c:411 entry_SYSENTER_compat_after_hwframe+0x84/0x8e Memory state around the buggy address: ffff888028d34d00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888028d34d80: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff888028d34e00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff888028d34e80: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888028d34f00: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ==================================================================