================================================================== BUG: KASAN: use-after-free in skb_headlen include/linux/skbuff.h:2380 [inline] BUG: KASAN: use-after-free in __skb_datagram_iter+0x703/0x780 net/core/datagram.c:411 Read of size 4 at addr ffff888108de27f0 by task syz-executor.0/1651 CPU: 0 PID: 1651 Comm: syz-executor.0 Not tainted 6.1.43-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/09/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:395 kasan_report+0x13c/0x170 mm/kasan/report.c:495 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350 skb_headlen include/linux/skbuff.h:2380 [inline] __skb_datagram_iter+0x703/0x780 net/core/datagram.c:411 skb_copy_datagram_iter+0x43/0x180 net/core/datagram.c:527 skb_copy_datagram_msg include/linux/skbuff.h:3916 [inline] unix_stream_read_actor+0x70/0xb0 net/unix/af_unix.c:2921 unix_stream_recv_urg+0x1b4/0x300 net/unix/af_unix.c:2648 unix_stream_read_generic+0x2140/0x2220 net/unix/af_unix.c:2727 unix_stream_recvmsg+0x222/0x2b0 net/unix/af_unix.c:2958 ____sys_recvmsg+0x285/0x530 ___sys_recvmsg net/socket.c:2743 [inline] __sys_recvmsg+0x2e9/0x3d0 net/socket.c:2773 __do_sys_recvmsg net/socket.c:2783 [inline] __se_sys_recvmsg net/socket.c:2780 [inline] __x64_sys_recvmsg+0x7f/0x90 net/socket.c:2780 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+0x63/0xcd RIP: 0033:0x7f2a1f07cae9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f2a1fdf40c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002f RAX: ffffffffffffffda RBX: 00007f2a1f19c120 RCX: 00007f2a1f07cae9 RDX: 0000000040010083 RSI: 0000000020000140 RDI: 0000000000000004 RBP: 00007f2a1f0c847a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000006e R14: 00007f2a1f19c120 R15: 00007fff784a7828 Allocated by task 1650: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505 __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:737 slab_alloc_node mm/slub.c:3398 [inline] kmem_cache_alloc_node+0x18a/0x2d0 mm/slub.c:3443 __alloc_skb+0xcc/0x2e0 net/core/skbuff.c:497 alloc_skb include/linux/skbuff.h:1268 [inline] alloc_skb_with_frags+0xa6/0x680 net/core/skbuff.c:6148 sock_alloc_send_pskb+0x915/0xa50 net/core/sock.c:2726 sock_alloc_send_skb include/net/sock.h:1896 [inline] queue_oob+0x102/0x8e0 net/unix/af_unix.c:2114 unix_stream_sendmsg+0xe10/0x1070 net/unix/af_unix.c:2251 sock_sendmsg_nosec net/socket.c:716 [inline] sock_sendmsg net/socket.c:736 [inline] ____sys_sendmsg+0x5dc/0x9d0 net/socket.c:2482 ___sys_sendmsg net/socket.c:2536 [inline] __sys_sendmsg+0x2a9/0x390 net/socket.c:2565 __do_sys_sendmsg net/socket.c:2574 [inline] __se_sys_sendmsg net/socket.c:2572 [inline] __x64_sys_sendmsg+0x7f/0x90 net/socket.c:2572 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+0x63/0xcd Freed by task 1650: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0x131/0x180 mm/kasan/common.c:236 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook mm/slub.c:1750 [inline] slab_free mm/slub.c:3661 [inline] kmem_cache_free+0x291/0x510 mm/slub.c:3683 kfree_skbmem+0x104/0x170 __kfree_skb net/core/skbuff.c:869 [inline] consume_skb+0xb4/0x250 net/core/skbuff.c:1033 queue_oob+0x52c/0x8e0 net/unix/af_unix.c:2145 unix_stream_sendmsg+0xe10/0x1070 net/unix/af_unix.c:2251 sock_sendmsg_nosec net/socket.c:716 [inline] sock_sendmsg net/socket.c:736 [inline] ____sys_sendmsg+0x5dc/0x9d0 net/socket.c:2482 ___sys_sendmsg net/socket.c:2536 [inline] __sys_sendmsg+0x2a9/0x390 net/socket.c:2565 __do_sys_sendmsg net/socket.c:2574 [inline] __se_sys_sendmsg net/socket.c:2572 [inline] __x64_sys_sendmsg+0x7f/0x90 net/socket.c:2572 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+0x63/0xcd The buggy address belongs to the object at ffff888108de2780 which belongs to the cache skbuff_head_cache of size 240 The buggy address is located 112 bytes inside of 240-byte region [ffff888108de2780, ffff888108de2870) The buggy address belongs to the physical page: page:ffffea0004237880 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x108de2 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff88810896c8c0 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 1650, tgid 1648 (syz-executor.0), ts 67152588644, free_ts 67134116694 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e2/0x1f0 mm/page_alloc.c:2533 prep_new_page mm/page_alloc.c:2540 [inline] get_page_from_freelist+0x2e7a/0x2f50 mm/page_alloc.c:4292 __alloc_pages+0x3c2/0x7d0 mm/page_alloc.c:5559 allocate_slab mm/slub.c:1939 [inline] new_slab+0xce/0x4c0 mm/slub.c:1992 ___slab_alloc+0x6f9/0xb80 mm/slub.c:3180 __slab_alloc+0x5d/0xa0 mm/slub.c:3279 slab_alloc_node mm/slub.c:3364 [inline] kmem_cache_alloc_node+0x1c9/0x2d0 mm/slub.c:3443 __alloc_skb+0xcc/0x2e0 net/core/skbuff.c:497 alloc_skb include/linux/skbuff.h:1268 [inline] alloc_skb_with_frags+0xa6/0x680 net/core/skbuff.c:6148 sock_alloc_send_pskb+0x915/0xa50 net/core/sock.c:2726 sock_alloc_send_skb include/net/sock.h:1896 [inline] queue_oob+0x102/0x8e0 net/unix/af_unix.c:2114 unix_stream_sendmsg+0xe10/0x1070 net/unix/af_unix.c:2251 sock_sendmsg_nosec net/socket.c:716 [inline] sock_sendmsg net/socket.c:736 [inline] ____sys_sendmsg+0x5dc/0x9d0 net/socket.c:2482 ___sys_sendmsg net/socket.c:2536 [inline] __sys_sendmsg+0x2a9/0x390 net/socket.c:2565 __do_sys_sendmsg net/socket.c:2574 [inline] __se_sys_sendmsg net/socket.c:2572 [inline] __x64_sys_sendmsg+0x7f/0x90 net/socket.c:2572 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1460 [inline] free_pcp_prepare mm/page_alloc.c:1533 [inline] free_unref_page_prepare+0x83d/0x850 mm/page_alloc.c:3388 free_unref_page+0x8d/0x480 mm/page_alloc.c:3484 free_the_page mm/page_alloc.c:770 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5648 __vunmap+0x9f3/0xb60 mm/vmalloc.c:2717 free_work+0x5b/0x80 mm/vmalloc.c:97 process_one_work+0x73d/0xcb0 kernel/workqueue.c:2292 worker_thread+0xa5d/0x1260 kernel/workqueue.c:2439 kthread+0x26d/0x300 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Memory state around the buggy address: ffff888108de2680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888108de2700: fb fb fb fb fb fb fc fc fc fc fc fc fc fc fc fc >ffff888108de2780: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888108de2800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc ffff888108de2880: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ==================================================================