================================================================== BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:71 [inline] BUG: KASAN: use-after-free in atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] BUG: KASAN: use-after-free in refcount_read include/linux/refcount.h:147 [inline] BUG: KASAN: use-after-free in skb_unref include/linux/skbuff.h:1079 [inline] BUG: KASAN: use-after-free in consume_skb+0x2e/0x160 net/core/skbuff.c:908 Read of size 4 at addr ffff888076a1e5dc by task kworker/0:3/3689 CPU: 0 PID: 3689 Comm: kworker/0:3 Not tainted 5.16.0-rc5-next-20211216-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events bpf_map_free_deferred Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xa5/0x3ed mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:459 check_region_inline mm/kasan/generic.c:183 [inline] kasan_check_range+0x13d/0x180 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:71 [inline] atomic_read include/linux/atomic/atomic-instrumented.h:27 [inline] refcount_read include/linux/refcount.h:147 [inline] skb_unref include/linux/skbuff.h:1079 [inline] consume_skb+0x2e/0x160 net/core/skbuff.c:908 __sk_msg_free+0x26d/0x360 net/core/skmsg.c:196 sk_msg_free net/core/skmsg.c:209 [inline] __sk_psock_purge_ingress_msg net/core/skmsg.c:748 [inline] __sk_psock_zap_ingress net/core/skmsg.c:766 [inline] sk_psock_stop+0x415/0x620 net/core/skmsg.c:784 sk_psock_drop+0x17b/0x390 net/core/skmsg.c:826 sk_psock_put include/linux/skmsg.h:461 [inline] sock_map_unref net/core/sock_map.c:185 [inline] sock_hash_free+0x714/0x930 net/core/sock_map.c:1146 process_one_work+0x9ac/0x1680 kernel/workqueue.c:2307 worker_thread+0x652/0x11c0 kernel/workqueue.c:2454 kthread+0x405/0x4f0 kernel/kthread.c:345 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 13052: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] __kasan_slab_alloc+0x90/0xc0 mm/kasan/common.c:469 kasan_slab_alloc include/linux/kasan.h:260 [inline] slab_post_alloc_hook mm/slab.h:766 [inline] slab_alloc_node mm/slub.c:3231 [inline] slab_alloc mm/slub.c:3239 [inline] kmem_cache_alloc+0x202/0x3a0 mm/slub.c:3244 skb_clone+0x170/0x3c0 net/core/skbuff.c:1517 sk_psock_verdict_recv+0x72/0x780 net/core/skmsg.c:1159 unix_read_sock+0xd7/0x250 net/unix/af_unix.c:2507 sk_psock_verdict_data_ready+0x11a/0x180 net/core/skmsg.c:1202 unix_dgram_sendmsg+0xf2c/0x1a10 net/unix/af_unix.c:2028 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:724 ____sys_sendmsg+0x331/0x810 net/socket.c:2409 ___sys_sendmsg+0xf3/0x170 net/socket.c:2463 __sys_sendmmsg+0x195/0x470 net/socket.c:2549 __do_sys_sendmmsg net/socket.c:2578 [inline] __se_sys_sendmmsg net/socket.c:2575 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2575 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 3693: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x166/0x1a0 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:236 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754 slab_free mm/slub.c:3510 [inline] kmem_cache_free+0xdd/0x580 mm/slub.c:3527 kfree_skbmem+0xef/0x1b0 net/core/skbuff.c:700 __kfree_skb net/core/skbuff.c:757 [inline] kfree_skb net/core/skbuff.c:774 [inline] kfree_skb+0x140/0x3f0 net/core/skbuff.c:768 sock_drop include/linux/skmsg.h:310 [inline] sk_psock_backlog+0x9de/0xea0 net/core/skmsg.c:668 process_one_work+0x9ac/0x1680 kernel/workqueue.c:2307 worker_thread+0x652/0x11c0 kernel/workqueue.c:2454 kthread+0x405/0x4f0 kernel/kthread.c:345 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff888076a1e500 which belongs to the cache skbuff_head_cache of size 232 The buggy address is located 220 bytes inside of 232-byte region [ffff888076a1e500, ffff888076a1e5e8) The buggy address belongs to the page: page:ffffea0001da8780 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x76a1e memcg:ffff888015c94781 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 dead000000000100 dead000000000122 ffff888015991640 raw: 0000000000000000 00000000000c000c 00000001ffffffff ffff888015c94781 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 5992, ts 313022157371, free_ts 312973463688 prep_new_page mm/page_alloc.c:2433 [inline] get_page_from_freelist+0xa72/0x2f40 mm/page_alloc.c:4164 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5376 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2271 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab mm/slub.c:1944 [inline] new_slab+0x28d/0x3a0 mm/slub.c:2004 ___slab_alloc+0x6be/0xd60 mm/slub.c:3019 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3106 slab_alloc_node mm/slub.c:3197 [inline] kmem_cache_alloc_node+0x122/0x3e0 mm/slub.c:3267 __alloc_skb+0x215/0x340 net/core/skbuff.c:414 alloc_skb include/linux/skbuff.h:1129 [inline] alloc_skb_with_frags+0x93/0x730 net/core/skbuff.c:5954 sock_alloc_send_pskb+0x793/0x920 net/core/sock.c:2581 unix_dgram_sendmsg+0x414/0x1a10 net/unix/af_unix.c:1895 unix_seqpacket_sendmsg+0x111/0x1a0 net/unix/af_unix.c:2345 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:724 ____sys_sendmsg+0x331/0x810 net/socket.c:2409 ___sys_sendmsg+0xf3/0x170 net/socket.c:2463 __sys_sendmmsg+0x195/0x470 net/socket.c:2549 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1351 [inline] free_pcp_prepare+0x414/0xb60 mm/page_alloc.c:1403 free_unref_page_prepare mm/page_alloc.c:3324 [inline] free_unref_page_list+0x1a9/0xfa0 mm/page_alloc.c:3440 release_pages+0x3ed/0x1b30 mm/swap.c:980 tlb_batch_pages_flush mm/mmu_gather.c:50 [inline] tlb_flush_mmu_free mm/mmu_gather.c:243 [inline] tlb_flush_mmu mm/mmu_gather.c:250 [inline] tlb_finish_mmu+0x165/0x8c0 mm/mmu_gather.c:341 exit_mmap+0x21b/0x670 mm/mmap.c:3181 __mmput+0x122/0x4b0 kernel/fork.c:1116 mmput+0x56/0x60 kernel/fork.c:1137 exit_mm kernel/exit.c:507 [inline] do_exit+0xb27/0x2c20 kernel/exit.c:819 do_group_exit+0x125/0x310 kernel/exit.c:929 get_signal+0x34c/0x28b0 kernel/signal.c:2859 arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:868 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop kernel/entry/common.c:172 [inline] exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:207 __syscall_exit_to_user_mode_work kernel/entry/common.c:289 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:300 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff888076a1e480: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc ffff888076a1e500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888076a1e580: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ^ ffff888076a1e600: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff888076a1e680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================