================================================================== 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:1066 [inline] BUG: KASAN: use-after-free in consume_skb+0x2e/0x160 net/core/skbuff.c:908 Read of size 4 at addr ffff88809845671c by task syz-executor.2/29270 CPU: 1 PID: 29270 Comm: syz-executor.2 Not tainted 5.15.0-rc7-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 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+0x6c/0x309 mm/kasan/report.c:256 __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:1066 [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:738 [inline] __sk_psock_zap_ingress net/core/skmsg.c:756 [inline] sk_psock_stop+0x415/0x620 net/core/skmsg.c:774 sock_map_close+0x34a/0x780 net/core/sock_map.c:1516 unix_release+0x7a/0xe0 net/unix/af_unix.c:948 __sock_release+0xcd/0x280 net/socket.c:649 sock_close+0x18/0x20 net/socket.c:1314 __fput+0x288/0x9f0 fs/file_table.c:280 task_work_run+0xdd/0x1a0 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:175 [inline] exit_to_user_mode_prepare+0x27e/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 RIP: 0033:0x7fc62348a72b Code: 0f 05 48 3d 00 f0 ff ff 77 45 c3 0f 1f 40 00 48 83 ec 18 89 7c 24 0c e8 63 fc ff ff 8b 7c 24 0c 41 89 c0 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 89 44 24 0c e8 a1 fc ff ff 8b 44 RSP: 002b:00007ffe99c428a0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000008 RCX: 00007fc62348a72b RDX: 0000001b2d227898 RSI: ffffffff8437ae9c RDI: 0000000000000007 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000001b2d226690 R10: 0000000000000218 R11: 0000000000000293 R12: 00007fc6235ebb60 R13: 00007fc6235ebb60 R14: 00007fc6235eaf60 R15: 00000000001af60d Allocated by task 29274: kasan_save_stack+0x1b/0x40 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+0x83/0xb0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:3213 [inline] slab_alloc mm/slub.c:3221 [inline] kmem_cache_alloc+0x209/0x390 mm/slub.c:3226 skb_clone+0x170/0x3c0 net/core/skbuff.c:1521 sk_psock_verdict_recv+0x72/0x7e0 net/core/skmsg.c:1134 unix_read_sock+0xd7/0x250 net/unix/af_unix.c:2420 sk_psock_verdict_data_ready+0x11a/0x180 net/core/skmsg.c:1177 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 9151: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xff/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1700 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1726 slab_free mm/slub.c:3492 [inline] kmem_cache_free+0x95/0x4e0 mm/slub.c:3508 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+0x93b/0xda0 net/core/skmsg.c:658 process_one_work+0x9bf/0x16b0 kernel/workqueue.c:2297 worker_thread+0x658/0x11f0 kernel/workqueue.c:2444 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff888098456640 which belongs to the cache skbuff_head_cache of size 232 The buggy address is located 220 bytes inside of 232-byte region [ffff888098456640, ffff888098456728) The buggy address belongs to the page: page:ffffea0002611580 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x98456 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 dead000000000100 dead000000000122 ffff8881447ef000 raw: 0000000000000000 00000000000c000c 00000001ffffffff 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 0x12a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 6458, ts 1656528357200, free_ts 1656522678010 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4155 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5381 alloc_pages+0x1a7/0x300 mm/mempolicy.c:2191 alloc_slab_page mm/slub.c:1770 [inline] allocate_slab mm/slub.c:1907 [inline] new_slab+0x319/0x490 mm/slub.c:1970 ___slab_alloc+0x950/0x1050 mm/slub.c:3001 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3088 slab_alloc_node mm/slub.c:3179 [inline] slab_alloc mm/slub.c:3221 [inline] kmem_cache_alloc+0x365/0x390 mm/slub.c:3226 skb_clone+0x170/0x3c0 net/core/skbuff.c:1521 dev_queue_xmit_nit+0x38c/0xa90 net/core/dev.c:2288 xmit_one net/core/dev.c:3577 [inline] dev_hard_start_xmit+0xad/0x920 net/core/dev.c:3598 sch_direct_xmit+0x19f/0xbc0 net/sched/sch_generic.c:342 __dev_xmit_skb net/core/dev.c:3809 [inline] __dev_queue_xmit+0x1489/0x36e0 net/core/dev.c:4177 neigh_hh_output include/net/neighbour.h:499 [inline] neigh_output include/net/neighbour.h:508 [inline] ip_finish_output2+0xf01/0x2140 net/ipv4/ip_output.c:221 __ip_finish_output net/ipv4/ip_output.c:299 [inline] __ip_finish_output+0x396/0x640 net/ipv4/ip_output.c:281 ip_finish_output+0x32/0x200 net/ipv4/ip_output.c:309 NF_HOOK_COND include/linux/netfilter.h:296 [inline] ip_output+0x196/0x310 net/ipv4/ip_output.c:423 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare+0x2c5/0x780 mm/page_alloc.c:1391 free_unref_page_prepare mm/page_alloc.c:3317 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3396 __vunmap+0x783/0xb70 mm/vmalloc.c:2621 __vfree+0x3c/0xd0 mm/vmalloc.c:2669 vfree+0x5a/0x90 mm/vmalloc.c:2700 copy_entries_to_user net/ipv6/netfilter/ip6_tables.c:884 [inline] get_entries net/ipv6/netfilter/ip6_tables.c:1041 [inline] do_ip6t_get_ctl+0x835/0xa10 net/ipv6/netfilter/ip6_tables.c:1672 nf_getsockopt+0x72/0xd0 net/netfilter/nf_sockopt.c:116 ipv6_getsockopt+0x1be/0x270 net/ipv6/ipv6_sockglue.c:1486 tcp_getsockopt+0x86/0xd0 net/ipv4/tcp.c:4251 __sys_getsockopt+0x21f/0x5f0 net/socket.c:2220 __do_sys_getsockopt net/socket.c:2235 [inline] __se_sys_getsockopt net/socket.c:2232 [inline] __x64_sys_getsockopt+0xba/0x150 net/socket.c:2232 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 Memory state around the buggy address: ffff888098456600: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff888098456680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888098456700: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc ^ ffff888098456780: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888098456800: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc ==================================================================