================================================================== 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:1076 [inline] BUG: KASAN: use-after-free in consume_skb+0x2e/0x160 net/core/skbuff.c:908 Read of size 4 at addr ffff88802266c79c by task kworker/3:4/7658 CPU: 3 PID: 7658 Comm: kworker/3:4 Not tainted 5.16.0-rc2-syzkaller #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.14.0-2 04/01/2014 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+0x8d/0x2ed mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:450 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:1076 [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+0x150/0x3d0 net/core/skmsg.c:826 sk_psock_put include/linux/skmsg.h:461 [inline] sock_map_unref net/core/sock_map.c:182 [inline] sock_hash_free+0x714/0x930 net/core/sock_map.c:1141 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 10595: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0x85/0xb0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:259 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc mm/slab.c:3323 [inline] kmem_cache_alloc+0x265/0x560 mm/slab.c:3507 skb_clone+0x170/0x3c0 net/core/skbuff.c:1521 sk_psock_verdict_recv+0x72/0x780 net/core/skmsg.c:1157 unix_read_sock+0xd7/0x250 net/unix/af_unix.c:2420 sk_psock_verdict_data_ready+0x11a/0x180 net/core/skmsg.c:1200 unix_dgram_sendmsg+0xfa7/0x1950 net/unix/af_unix.c:1941 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 52: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xd1/0x110 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:235 [inline] __cache_free mm/slab.c:3445 [inline] kmem_cache_free.part.0+0x91/0x200 mm/slab.c:3741 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+0x9b2/0x1690 kernel/workqueue.c:2298 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff88802266c6c0 which belongs to the cache skbuff_head_cache of size 232 The buggy address is located 220 bytes inside of 232-byte region [ffff88802266c6c0, ffff88802266c7a8) The buggy address belongs to the page: page:ffffea0000899b00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x2266c memcg:ffff8880697e2801 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea000077f988 ffffea000095ed48 ffff8880402a4800 raw: 0000000000000000 ffff88802266c080 000000010000000c ffff8880697e2801 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x242220(__GFP_HIGH|__GFP_ATOMIC|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 8248, ts 418335292088, free_ts 413304572494 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4149 __alloc_pages_slowpath.constprop.0+0x2eb/0x20d0 mm/page_alloc.c:4914 __alloc_pages+0x412/0x500 mm/page_alloc.c:5382 __alloc_pages_node include/linux/gfp.h:570 [inline] kmem_getpages mm/slab.c:1377 [inline] cache_grow_begin+0x75/0x470 mm/slab.c:2593 cache_alloc_refill+0x27f/0x380 mm/slab.c:2965 ____cache_alloc mm/slab.c:3048 [inline] ____cache_alloc mm/slab.c:3031 [inline] __do_cache_alloc mm/slab.c:3275 [inline] slab_alloc mm/slab.c:3316 [inline] kmem_cache_alloc+0x450/0x560 mm/slab.c:3507 skb_clone+0x170/0x3c0 net/core/skbuff.c:1521 sk_psock_verdict_recv+0x72/0x780 net/core/skmsg.c:1157 unix_read_sock+0xd7/0x250 net/unix/af_unix.c:2420 sk_psock_verdict_data_ready+0x11a/0x180 net/core/skmsg.c:1200 unix_dgram_sendmsg+0xfa7/0x1950 net/unix/af_unix.c:1941 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 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1338 [inline] free_pcp_prepare+0x374/0x870 mm/page_alloc.c:1389 free_unref_page_prepare mm/page_alloc.c:3309 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3388 __put_single_page mm/swap.c:99 [inline] __put_page+0x13d/0x470 mm/swap.c:130 folio_put include/linux/mm.h:1237 [inline] put_page include/linux/mm.h:1255 [inline] unmap_and_move mm/migrate.c:1237 [inline] migrate_pages+0x2737/0x3810 mm/migrate.c:1481 compact_zone+0x1abb/0x3860 mm/compaction.c:2399 proactive_compact_node+0x103/0x1c0 mm/compaction.c:2653 kcompactd+0x5b4/0xf30 mm/compaction.c:2963 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88802266c680: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff88802266c700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802266c780: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc ^ ffff88802266c800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802266c880: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ==================================================================