================================================================== BUG: KASAN: slab-use-after-free in __unix_gc+0xe0f/0xf70 Read of size 8 at addr ffff88802ca54640 by task kworker/u4:10/2894 CPU: 0 PID: 2894 Comm: kworker/u4:10 Not tainted 6.8.0-rc3-syzkaller-00957-gdfe7f12788f5 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 Workqueue: events_unbound __unix_gc Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2e0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:377 [inline] print_report+0x167/0x540 mm/kasan/report.c:488 kasan_report+0x142/0x180 mm/kasan/report.c:601 __unix_gc+0xe0f/0xf70 process_one_work kernel/workqueue.c:2633 [inline] process_scheduled_works+0x913/0x1420 kernel/workqueue.c:2706 worker_thread+0xa5f/0x1000 kernel/workqueue.c:2787 kthread+0x2ef/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:242 Allocated by task 18740: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:314 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:340 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3813 [inline] slab_alloc_node mm/slub.c:3860 [inline] kmem_cache_alloc+0x16f/0x340 mm/slub.c:3867 sk_prot_alloc+0x58/0x210 net/core/sock.c:2073 sk_alloc+0x38/0x370 net/core/sock.c:2132 unix_create1+0xb4/0x7f0 unix_create+0x14e/0x200 net/unix/af_unix.c:1047 __sock_create+0x48f/0x920 net/socket.c:1571 sock_create net/socket.c:1622 [inline] __sys_socketpair+0x33d/0x720 net/socket.c:1773 __do_sys_socketpair net/socket.c:1822 [inline] __se_sys_socketpair net/socket.c:1819 [inline] __x64_sys_socketpair+0x9b/0xb0 net/socket.c:1819 do_syscall_64+0xf9/0x240 entry_SYSCALL_64_after_hwframe+0x6f/0x77 Freed by task 9: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x4e/0x60 mm/kasan/generic.c:640 poison_slab_object+0xa6/0xe0 mm/kasan/common.c:241 __kasan_slab_free+0x34/0x70 mm/kasan/common.c:257 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2121 [inline] slab_free mm/slub.c:4299 [inline] kmem_cache_free+0x102/0x2a0 mm/slub.c:4363 sk_prot_free net/core/sock.c:2113 [inline] __sk_destruct+0x470/0x5f0 net/core/sock.c:2207 sock_put include/net/sock.h:1961 [inline] unix_release_sock+0x903/0xd20 net/unix/af_unix.c:649 unix_release+0x91/0xc0 net/unix/af_unix.c:1062 __sock_release net/socket.c:659 [inline] sock_close+0xbc/0x240 net/socket.c:1421 __fput+0x429/0x8a0 fs/file_table.c:376 delayed_fput+0x59/0x80 fs/file_table.c:399 process_one_work kernel/workqueue.c:2633 [inline] process_scheduled_works+0x913/0x1420 kernel/workqueue.c:2706 worker_thread+0xa5f/0x1000 kernel/workqueue.c:2787 kthread+0x2ef/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1b/0x30 arch/x86/entry/entry_64.S:242 The buggy address belongs to the object at ffff88802ca54000 which belongs to the cache UNIX-STREAM of size 1920 The buggy address is located 1600 bytes inside of freed 1920-byte region [ffff88802ca54000, ffff88802ca54780) The buggy address belongs to the physical page: page:ffffea0000b29400 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802ca55000 pfn:0x2ca50 head:ffffea0000b29400 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888014db0401 flags: 0xfff00000000840(slab|head|node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 00fff00000000840 ffff8880173f78c0 ffffea000058d400 0000000000000002 raw: ffff88802ca55000 000000008010000f 00000001ffffffff ffff888014db0401 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 15640, tgid 15639 (syz-executor.2), ts 1023883603310, free_ts 1023790268106 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1ea/0x210 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0x33ea/0x3580 mm/page_alloc.c:3311 __alloc_pages+0x255/0x680 mm/page_alloc.c:4567 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page+0x5f/0x160 mm/slub.c:2190 allocate_slab mm/slub.c:2354 [inline] new_slab+0x84/0x2f0 mm/slub.c:2407 ___slab_alloc+0xd17/0x13e0 mm/slub.c:3540 __slab_alloc mm/slub.c:3625 [inline] __slab_alloc_node mm/slub.c:3678 [inline] slab_alloc_node mm/slub.c:3850 [inline] kmem_cache_alloc+0x24d/0x340 mm/slub.c:3867 sk_prot_alloc+0x58/0x210 net/core/sock.c:2073 sk_alloc+0x38/0x370 net/core/sock.c:2132 unix_create1+0xb4/0x7f0 unix_create+0x14e/0x200 net/unix/af_unix.c:1047 __sock_create+0x48f/0x920 net/socket.c:1571 sock_create net/socket.c:1622 [inline] __sys_socketpair+0x33d/0x720 net/socket.c:1773 __do_sys_socketpair net/socket.c:1822 [inline] __se_sys_socketpair net/socket.c:1819 [inline] __x64_sys_socketpair+0x9b/0xb0 net/socket.c:1819 do_syscall_64+0xf9/0x240 entry_SYSCALL_64_after_hwframe+0x6f/0x77 page last free pid 5078 tgid 5078 stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1140 [inline] free_unref_page_prepare+0x968/0xa90 mm/page_alloc.c:2346 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2486 discard_slab mm/slub.c:2453 [inline] __put_partials+0xeb/0x130 mm/slub.c:2922 put_cpu_partial+0x17b/0x250 mm/slub.c:2997 __slab_free+0x302/0x410 mm/slub.c:4166 qlink_free mm/kasan/quarantine.c:160 [inline] qlist_free_all+0x6d/0xd0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:324 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3813 [inline] slab_alloc_node mm/slub.c:3860 [inline] kmalloc_node_trace+0x190/0x3a0 mm/slub.c:4020 kmalloc_node include/linux/slab.h:606 [inline] kzalloc_node include/linux/slab.h:722 [inline] __get_vm_area_node+0x125/0x370 mm/vmalloc.c:2588 __vmalloc_node_range+0x3df/0x14a0 mm/vmalloc.c:3280 __vmalloc_node mm/vmalloc.c:3385 [inline] vzalloc+0x79/0x90 mm/vmalloc.c:3458 alloc_counters+0xd7/0x770 net/ipv4/netfilter/arp_tables.c:660 copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:837 [inline] get_entries net/ipv6/netfilter/ip6_tables.c:1039 [inline] do_ip6t_get_ctl+0xeca/0x1820 net/ipv6/netfilter/ip6_tables.c:1669 nf_getsockopt+0x299/0x2c0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x263/0x380 net/ipv6/ipv6_sockglue.c:1488 Memory state around the buggy address: ffff88802ca54500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802ca54580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802ca54600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802ca54680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802ca54700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================