================================================================== BUG: KASAN: slab-use-after-free in __unix_gc+0xe3a/0xf70 net/unix/garbage.c:344 Read of size 8 at addr ffff8880237cc770 by task kworker/u8:4/56 CPU: 0 PID: 56 Comm: kworker/u8:4 Not tainted 6.8.0-rc3-next-20240209-syzkaller #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+0x241/0x360 lib/dump_stack.c:114 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 __unix_gc+0xe3a/0xf70 net/unix/garbage.c:344 process_one_work kernel/workqueue.c:3143 [inline] process_scheduled_works+0x9d7/0x1730 kernel/workqueue.c:3223 worker_thread+0x86d/0xd70 kernel/workqueue.c:3304 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:242 Allocated by task 13799: 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:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3814 [inline] slab_alloc_node mm/slub.c:3861 [inline] kmem_cache_alloc+0x172/0x350 mm/slub.c:3868 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+0x490/0x920 net/socket.c:1571 sock_create net/socket.c:1622 [inline] __sys_socketpair+0x33e/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+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 Freed by task 5113: 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:586 poison_slab_object+0xa6/0xe0 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2122 [inline] slab_free mm/slub.c:4296 [inline] kmem_cache_free+0x102/0x2a0 mm/slub.c:4360 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:411 delayed_fput+0x59/0x80 fs/file_table.c:434 process_one_work kernel/workqueue.c:3143 [inline] process_scheduled_works+0x9d7/0x1730 kernel/workqueue.c:3223 worker_thread+0x86d/0xd70 kernel/workqueue.c:3304 kthread+0x2f0/0x390 kernel/kthread.c:388 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:242 The buggy address belongs to the object at ffff8880237cc000 which belongs to the cache UNIX-STREAM of size 1920 The buggy address is located 1904 bytes inside of freed 1920-byte region [ffff8880237cc000, ffff8880237cc780) The buggy address belongs to the physical page: page:ffffea00008df200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x237c8 head:ffffea00008df200 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888016392001 flags: 0xfff80000000840(slab|head|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 00fff80000000840 ffff8880173d8140 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080100010 00000001ffffffff ffff888016392001 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4818, tgid 4818 (sshd), ts 68010546937, free_ts 68009378392 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1ea/0x210 mm/page_alloc.c:1539 prep_new_page mm/page_alloc.c:1546 [inline] get_page_from_freelist+0x34eb/0x3680 mm/page_alloc.c:3353 __alloc_pages+0x256/0x6a0 mm/page_alloc.c:4609 __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:2191 allocate_slab mm/slub.c:2354 [inline] new_slab+0x84/0x2f0 mm/slub.c:2407 ___slab_alloc+0xc73/0x1260 mm/slub.c:3541 __slab_alloc mm/slub.c:3626 [inline] __slab_alloc_node mm/slub.c:3679 [inline] slab_alloc_node mm/slub.c:3851 [inline] kmem_cache_alloc+0x250/0x350 mm/slub.c:3868 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+0x490/0x920 net/socket.c:1571 sock_create net/socket.c:1622 [inline] __sys_socketpair+0x2ca/0x720 net/socket.c:1769 __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+0xfb/0x240 entry_SYSCALL_64_after_hwframe+0x6d/0x75 page last free pid 0 tgid 0 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:2388 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2528 page_to_skb+0x3dc/0x9b0 drivers/net/virtio_net.c:621 receive_mergeable drivers/net/virtio_net.c:1683 [inline] receive_buf+0x3b3/0x3860 drivers/net/virtio_net.c:1804 virtnet_receive drivers/net/virtio_net.c:2110 [inline] virtnet_poll+0x720/0x18f0 drivers/net/virtio_net.c:2203 __napi_poll+0xcb/0x490 net/core/dev.c:6613 napi_poll net/core/dev.c:6682 [inline] net_rx_action+0x78b/0x1010 net/core/dev.c:6815 __do_softirq+0x2bc/0x943 kernel/softirq.c:554 Memory state around the buggy address: ffff8880237cc600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880237cc680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880237cc700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880237cc780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880237cc800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================