================================================================== 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:1107 [inline] BUG: KASAN: use-after-free in consume_skb+0x3c/0x250 net/core/skbuff.c:910 Read of size 4 at addr ffff888121599e9c by task syz-executor.0/433 CPU: 0 PID: 433 Comm: syz-executor.0 Not tainted 5.15.131-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description+0x87/0x3a0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x177/0x1c0 mm/kasan/report.c:451 kasan_check_range+0x293/0x2a0 mm/kasan/generic.c:189 __kasan_check_read+0x11/0x20 mm/kasan/shadow.c:31 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:1107 [inline] consume_skb+0x3c/0x250 net/core/skbuff.c:910 __sk_msg_free+0x2dd/0x370 net/core/skmsg.c:205 sk_msg_free net/core/skmsg.c:218 [inline] __sk_psock_purge_ingress_msg net/core/skmsg.c:769 [inline] __sk_psock_zap_ingress net/core/skmsg.c:787 [inline] sk_psock_stop+0x450/0x4d0 net/core/skmsg.c:805 sock_map_close+0x87/0x190 net/core/sock_map.c:1568 unix_release+0x82/0xc0 net/unix/af_unix.c:949 __sock_release net/socket.c:649 [inline] sock_close+0xdf/0x270 net/socket.c:1317 __fput+0x3fe/0x910 fs/file_table.c:280 ____fput+0x15/0x20 fs/file_table.c:308 task_work_run+0x129/0x190 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0xc4/0xe0 kernel/entry/common.c:175 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x26/0x160 kernel/entry/common.c:301 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f51baba59da Code: 48 3d 00 f0 ff ff 77 48 c3 0f 1f 80 00 00 00 00 48 83 ec 18 89 7c 24 0c e8 03 7f 02 00 8b 7c 24 0c 89 c2 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 36 89 d7 89 44 24 0c e8 63 7f 02 00 8b 44 24 RSP: 002b:00007fff4f5431b0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000004 RCX: 00007f51baba59da RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 00007f51bacc7980 R08: 0000001b2e460000 R09: 00007fff4f5dd0b0 R10: 0000000000000000 R11: 0000000000000293 R12: 000000000000a204 R13: ffffffffffffffff R14: 00007f51ba72a000 R15: 0000000000009ec3 Allocated by task 434: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0xb1/0xe0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0xf5/0x200 mm/slub.c:3233 skb_clone+0x1d1/0x360 net/core/skbuff.c:1523 sk_psock_verdict_recv+0x53/0x840 net/core/skmsg.c:1186 unix_read_sock+0x132/0x380 net/unix/af_unix.c:2433 sk_psock_verdict_data_ready+0x147/0x1a0 net/core/skmsg.c:1229 unix_dgram_sendmsg+0x15fc/0x2090 net/unix/af_unix.c:1949 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg net/socket.c:724 [inline] ____sys_sendmsg+0x59e/0x8f0 net/socket.c:2412 ___sys_sendmsg+0x252/0x2e0 net/socket.c:2466 __sys_sendmmsg+0x2bf/0x530 net/socket.c:2552 __do_sys_sendmmsg net/socket.c:2581 [inline] __se_sys_sendmmsg net/socket.c:2578 [inline] __x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2578 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 373: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0x126/0x160 mm/kasan/common.c:366 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kmem_cache_free+0x116/0x2e0 mm/slub.c:3515 kfree_skbmem+0x104/0x170 __kfree_skb net/core/skbuff.c:757 [inline] kfree_skb_reason+0xc0/0x260 net/core/skbuff.c:776 kfree_skb include/linux/skbuff.h:1123 [inline] sock_drop include/linux/skmsg.h:314 [inline] sk_psock_backlog+0xc27/0xd90 net/core/skmsg.c:681 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2310 worker_thread+0xad2/0x12a0 kernel/workqueue.c:2457 kthread+0x421/0x510 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 The buggy address belongs to the object at ffff888121599dc0 which belongs to the cache skbuff_head_cache of size 232 The buggy address is located 220 bytes inside of 232-byte region [ffff888121599dc0, ffff888121599ea8) The buggy address belongs to the page: page:ffffea0004856640 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x121599 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff888100366640 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 373, ts 40657687012, free_ts 40342170110 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x15d/0x170 mm/page_alloc.c:2420 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x33e6/0x34c0 mm/page_alloc.c:4159 __alloc_pages+0x38a/0x7b0 mm/page_alloc.c:5421 allocate_slab mm/slub.c:1912 [inline] new_slab+0x92/0x490 mm/slub.c:1975 ___slab_alloc+0x39e/0x830 mm/slub.c:3008 __slab_alloc+0x4a/0x90 mm/slub.c:3095 slab_alloc_node mm/slub.c:3186 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0x134/0x200 mm/slub.c:3233 kmem_cache_alloc_node include/linux/slab.h:462 [inline] __alloc_skb+0xbe/0x550 net/core/skbuff.c:415 alloc_skb include/linux/skbuff.h:1167 [inline] alloc_skb_with_frags+0xa6/0x680 net/core/skbuff.c:6126 sock_alloc_send_pskb+0x915/0xa50 net/core/sock.c:2511 sock_alloc_send_skb+0x32/0x40 net/core/sock.c:2528 mld_newpack+0x1b4/0xa20 net/ipv6/mcast.c:1748 add_grhead net/ipv6/mcast.c:1851 [inline] add_grec+0xdc8/0x13a0 net/ipv6/mcast.c:1989 mld_send_cr net/ipv6/mcast.c:2115 [inline] mld_ifc_work+0x72e/0xbb0 net/ipv6/mcast.c:2653 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2310 worker_thread+0xad2/0x12a0 kernel/workqueue.c:2457 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 mm/page_alloc.c:1413 [inline] free_unref_page_prepare+0x7a9/0x7e0 mm/page_alloc.c:3317 free_unref_page+0x85/0x220 mm/page_alloc.c:3396 free_the_page mm/page_alloc.c:705 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5497 free_pages+0x7c/0x90 mm/page_alloc.c:5508 kasan_depopulate_vmalloc_pte+0x6a/0x90 mm/kasan/shadow.c:375 apply_to_pte_range mm/memory.c:2545 [inline] apply_to_pmd_range mm/memory.c:2589 [inline] apply_to_pud_range mm/memory.c:2625 [inline] apply_to_p4d_range mm/memory.c:2661 [inline] __apply_to_page_range+0x8dd/0xbe0 mm/memory.c:2695 apply_to_existing_page_range+0x38/0x50 mm/memory.c:2728 kasan_release_vmalloc+0x9a/0xb0 mm/kasan/shadow.c:485 __purge_vmap_area_lazy+0x154a/0x1690 mm/vmalloc.c:1704 _vm_unmap_aliases+0x339/0x3b0 mm/vmalloc.c:2107 vm_unmap_aliases+0x19/0x20 mm/vmalloc.c:2130 change_page_attr_set_clr+0x308/0x1050 arch/x86/mm/pat/set_memory.c:1740 change_page_attr_clear arch/x86/mm/pat/set_memory.c:1797 [inline] set_memory_ro+0xa1/0xe0 arch/x86/mm/pat/set_memory.c:1943 bpf_jit_binary_lock_ro include/linux/filter.h:888 [inline] bpf_int_jit_compile+0xbf42/0xc6d0 arch/x86/net/bpf_jit_comp.c:2372 bpf_prog_select_runtime+0x706/0x9e0 kernel/bpf/core.c:1926 bpf_prog_load+0x1315/0x1b50 kernel/bpf/syscall.c:2329 Memory state around the buggy address: ffff888121599d80: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ffff888121599e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888121599e80: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc ^ ffff888121599f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888121599f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ================================================================== BUG: KASAN: double-free or invalid-free in slab_free mm/slub.c:3499 [inline] BUG: KASAN: double-free or invalid-free in kmem_cache_free+0x116/0x2e0 mm/slub.c:3515 CPU: 0 PID: 433 Comm: syz-executor.0 Tainted: G B 5.15.131-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/04/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description+0x87/0x3a0 mm/kasan/report.c:248 kasan_report_invalid_free+0x52/0x80 mm/kasan/report.c:373 ____kasan_slab_free+0x13e/0x160 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kmem_cache_free+0x116/0x2e0 mm/slub.c:3515 kfree_skbmem+0x104/0x170 __kfree_skb net/core/skbuff.c:757 [inline] consume_skb+0xb4/0x250 net/core/skbuff.c:914 __sk_msg_free+0x2dd/0x370 net/core/skmsg.c:205 sk_msg_free net/core/skmsg.c:218 [inline] __sk_psock_purge_ingress_msg net/core/skmsg.c:769 [inline] __sk_psock_zap_ingress net/core/skmsg.c:787 [inline] sk_psock_stop+0x450/0x4d0 net/core/skmsg.c:805 sock_map_close+0x87/0x190 net/core/sock_map.c:1568 unix_release+0x82/0xc0 net/unix/af_unix.c:949 __sock_release net/socket.c:649 [inline] sock_close+0xdf/0x270 net/socket.c:1317 __fput+0x3fe/0x910 fs/file_table.c:280 ____fput+0x15/0x20 fs/file_table.c:308 task_work_run+0x129/0x190 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0xc4/0xe0 kernel/entry/common.c:175 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x26/0x160 kernel/entry/common.c:301 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x61/0xcb RIP: 0033:0x7f51baba59da Code: 48 3d 00 f0 ff ff 77 48 c3 0f 1f 80 00 00 00 00 48 83 ec 18 89 7c 24 0c e8 03 7f 02 00 8b 7c 24 0c 89 c2 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 36 89 d7 89 44 24 0c e8 63 7f 02 00 8b 44 24 RSP: 002b:00007fff4f5431b0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000004 RCX: 00007f51baba59da RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000003 RBP: 00007f51bacc7980 R08: 0000001b2e460000 R09: 00007fff4f5dd0b0 R10: 0000000000000000 R11: 0000000000000293 R12: 000000000000a204 R13: ffffffffffffffff R14: 00007f51ba72a000 R15: 0000000000009ec3 Allocated by task 434: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0xb1/0xe0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0xf5/0x200 mm/slub.c:3233 skb_clone+0x1d1/0x360 net/core/skbuff.c:1523 sk_psock_verdict_recv+0x53/0x840 net/core/skmsg.c:1186 unix_read_sock+0x132/0x380 net/unix/af_unix.c:2433 sk_psock_verdict_data_ready+0x147/0x1a0 net/core/skmsg.c:1229 unix_dgram_sendmsg+0x15fc/0x2090 net/unix/af_unix.c:1949 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg net/socket.c:724 [inline] ____sys_sendmsg+0x59e/0x8f0 net/socket.c:2412 ___sys_sendmsg+0x252/0x2e0 net/socket.c:2466 __sys_sendmmsg+0x2bf/0x530 net/socket.c:2552 __do_sys_sendmmsg net/socket.c:2581 [inline] __se_sys_sendmmsg net/socket.c:2578 [inline] __x64_sys_sendmmsg+0xa0/0xb0 net/socket.c:2578 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 373: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0x126/0x160 mm/kasan/common.c:366 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0xbd/0x190 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kmem_cache_free+0x116/0x2e0 mm/slub.c:3515 kfree_skbmem+0x104/0x170 __kfree_skb net/core/skbuff.c:757 [inline] kfree_skb_reason+0xc0/0x260 net/core/skbuff.c:776 kfree_skb include/linux/skbuff.h:1123 [inline] sock_drop include/linux/skmsg.h:314 [inline] sk_psock_backlog+0xc27/0xd90 net/core/skmsg.c:681 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2310 worker_thread+0xad2/0x12a0 kernel/workqueue.c:2457 kthread+0x421/0x510 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 The buggy address belongs to the object at ffff888121599dc0 which belongs to the cache skbuff_head_cache of size 232 The buggy address is located 0 bytes inside of 232-byte region [ffff888121599dc0, ffff888121599ea8) The buggy address belongs to the page: page:ffffea0004856640 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x121599 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff888100366640 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 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 373, ts 40657687012, free_ts 40342170110 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x15d/0x170 mm/page_alloc.c:2420 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x33e6/0x34c0 mm/page_alloc.c:4159 __alloc_pages+0x38a/0x7b0 mm/page_alloc.c:5421 allocate_slab mm/slub.c:1912 [inline] new_slab+0x92/0x490 mm/slub.c:1975 ___slab_alloc+0x39e/0x830 mm/slub.c:3008 __slab_alloc+0x4a/0x90 mm/slub.c:3095 slab_alloc_node mm/slub.c:3186 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0x134/0x200 mm/slub.c:3233 kmem_cache_alloc_node include/linux/slab.h:462 [inline] __alloc_skb+0xbe/0x550 net/core/skbuff.c:415 alloc_skb include/linux/skbuff.h:1167 [inline] alloc_skb_with_frags+0xa6/0x680 net/core/skbuff.c:6126 sock_alloc_send_pskb+0x915/0xa50 net/core/sock.c:2511 sock_alloc_send_skb+0x32/0x40 net/core/sock.c:2528 mld_newpack+0x1b4/0xa20 net/ipv6/mcast.c:1748 add_grhead net/ipv6/mcast.c:1851 [inline] add_grec+0xdc8/0x13a0 net/ipv6/mcast.c:1989 mld_send_cr net/ipv6/mcast.c:2115 [inline] mld_ifc_work+0x72e/0xbb0 net/ipv6/mcast.c:2653 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2310 worker_thread+0xad2/0x12a0 kernel/workqueue.c:2457 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 mm/page_alloc.c:1413 [inline] free_unref_page_prepare+0x7a9/0x7e0 mm/page_alloc.c:3317 free_unref_page+0x85/0x220 mm/page_alloc.c:3396 free_the_page mm/page_alloc.c:705 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5497 free_pages+0x7c/0x90 mm/page_alloc.c:5508 kasan_depopulate_vmalloc_pte+0x6a/0x90 mm/kasan/shadow.c:375 apply_to_pte_range mm/memory.c:2545 [inline] apply_to_pmd_range mm/memory.c:2589 [inline] apply_to_pud_range mm/memory.c:2625 [inline] apply_to_p4d_range mm/memory.c:2661 [inline] __apply_to_page_range+0x8dd/0xbe0 mm/memory.c:2695 apply_to_existing_page_range+0x38/0x50 mm/memory.c:2728 kasan_release_vmalloc+0x9a/0xb0 mm/kasan/shadow.c:485 __purge_vmap_area_lazy+0x154a/0x1690 mm/vmalloc.c:1704 _vm_unmap_aliases+0x339/0x3b0 mm/vmalloc.c:2107 vm_unmap_aliases+0x19/0x20 mm/vmalloc.c:2130 change_page_attr_set_clr+0x308/0x1050 arch/x86/mm/pat/set_memory.c:1740 change_page_attr_clear arch/x86/mm/pat/set_memory.c:1797 [inline] set_memory_ro+0xa1/0xe0 arch/x86/mm/pat/set_memory.c:1943 bpf_jit_binary_lock_ro include/linux/filter.h:888 [inline] bpf_int_jit_compile+0xbf42/0xc6d0 arch/x86/net/bpf_jit_comp.c:2372 bpf_prog_select_runtime+0x706/0x9e0 kernel/bpf/core.c:1926 bpf_prog_load+0x1315/0x1b50 kernel/bpf/syscall.c:2329 Memory state around the buggy address: ffff888121599c80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888121599d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc >ffff888121599d80: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ^ ffff888121599e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888121599e80: fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc ==================================================================