================================================================== BUG: KASAN: use-after-free in ip_cmsg_recv_dstaddr net/ipv4/ip_sockglue.c:167 [inline] BUG: KASAN: use-after-free in ip_cmsg_recv_offset+0x12be/0x1390 net/ipv4/ip_sockglue.c:230 Read of size 4 at addr ffff8801d1482520 by task syz-executor314/6617 CPU: 0 PID: 6617 Comm: syz-executor314 Not tainted 4.19.0-rc5+ #36 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1c4/0x2b4 lib/dump_stack.c:113 print_address_description.cold.8+0x9/0x1ff mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report.cold.9+0x242/0x309 mm/kasan/report.c:412 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 ip_cmsg_recv_dstaddr net/ipv4/ip_sockglue.c:167 [inline] ip_cmsg_recv_offset+0x12be/0x1390 net/ipv4/ip_sockglue.c:230 ip_cmsg_recv include/net/ip.h:679 [inline] raw_recvmsg+0x71d/0x8b0 net/ipv4/raw.c:797 inet_recvmsg+0x181/0x6d0 net/ipv4/af_inet.c:830 sock_recvmsg_nosec net/socket.c:794 [inline] sock_recvmsg+0xd0/0x110 net/socket.c:801 sock_read_iter+0x39b/0x570 net/socket.c:878 call_read_iter include/linux/fs.h:1802 [inline] do_iter_readv_writev+0x77c/0xa80 fs/read_write.c:678 do_iter_read+0x26e/0x650 fs/read_write.c:922 vfs_readv+0x175/0x1c0 fs/read_write.c:986 do_readv+0x11a/0x310 fs/read_write.c:1019 __do_sys_readv fs/read_write.c:1106 [inline] __se_sys_readv fs/read_write.c:1103 [inline] __x64_sys_readv+0x75/0xb0 fs/read_write.c:1103 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x446579 Code: e8 0c e8 ff ff 48 83 c4 18 c3 0f 1f 80 00 00 00 00 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 0f 83 7b 08 fc ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fb09f390da8 EFLAGS: 00000293 ORIG_RAX: 0000000000000013 RAX: ffffffffffffffda RBX: 00000000006dbc28 RCX: 0000000000446579 RDX: 0000000000000001 RSI: 0000000020000500 RDI: 0000000000000003 RBP: 00000000006dbc20 R08: 0000000000000000 R09: 0000000000000000 R10: 000000000000006e R11: 0000000000000293 R12: 00000000006dbc2c R13: 00000000004ae620 R14: 0000000020001300 R15: 0000000000000000 Allocated by task 6610: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc+0xc7/0xe0 mm/kasan/kasan.c:553 __do_kmalloc_node mm/slab.c:3682 [inline] __kmalloc_node_track_caller+0x47/0x70 mm/slab.c:3696 __kmalloc_reserve.isra.39+0x41/0xe0 net/core/skbuff.c:137 __alloc_skb+0x155/0x770 net/core/skbuff.c:205 alloc_skb include/linux/skbuff.h:995 [inline] __ip_append_data.isra.47+0x21d6/0x29b0 net/ipv4/ip_output.c:988 ip_append_data.part.48+0xef/0x170 net/ipv4/ip_output.c:1196 ip_append_data+0x6d/0x90 net/ipv4/ip_output.c:1185 raw_sendmsg+0x1220/0x4380 net/ipv4/raw.c:671 inet_sendmsg+0x1a1/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:631 __sys_sendto+0x3d7/0x670 net/socket.c:1788 __do_sys_sendto net/socket.c:1800 [inline] __se_sys_sendto net/socket.c:1796 [inline] __x64_sys_sendto+0xe1/0x1a0 net/socket.c:1796 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 6618: save_stack+0x43/0xd0 mm/kasan/kasan.c:448 set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3498 [inline] kfree+0xcf/0x230 mm/slab.c:3813 skb_free_head+0x99/0xc0 net/core/skbuff.c:550 skb_release_data+0x6a4/0x880 net/core/skbuff.c:570 skb_release_all+0x4a/0x60 net/core/skbuff.c:627 __kfree_skb net/core/skbuff.c:641 [inline] consume_skb+0x1ae/0x570 net/core/skbuff.c:701 ip_do_fragment+0x1194/0x2ae0 net/ipv4/ip_output.c:819 ip_fragment.constprop.49+0x179/0x240 net/ipv4/ip_output.c:549 ip_finish_output+0x6b4/0xf60 net/ipv4/ip_output.c:315 NF_HOOK_COND include/linux/netfilter.h:276 [inline] ip_mc_output+0x2c4/0x15b0 net/ipv4/ip_output.c:390 dst_output include/net/dst.h:444 [inline] ip_local_out+0xc5/0x1b0 net/ipv4/ip_output.c:124 ip_send_skb+0x40/0xe0 net/ipv4/ip_output.c:1441 ip_push_pending_frames+0x64/0x80 net/ipv4/ip_output.c:1461 raw_sendmsg+0x1e23/0x4380 net/ipv4/raw.c:677 inet_sendmsg+0x1a1/0x690 net/ipv4/af_inet.c:798 sock_sendmsg_nosec net/socket.c:621 [inline] sock_sendmsg+0xd5/0x120 net/socket.c:631 ___sys_sendmsg+0x51d/0x930 net/socket.c:2116 __sys_sendmmsg+0x246/0x6d0 net/socket.c:2211 __do_sys_sendmmsg net/socket.c:2240 [inline] __se_sys_sendmmsg net/socket.c:2237 [inline] __x64_sys_sendmmsg+0x9d/0x100 net/socket.c:2237 do_syscall_64+0x1b9/0x820 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8801d1482500 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 32 bytes inside of 512-byte region [ffff8801d1482500, ffff8801d1482700) The buggy address belongs to the page: page:ffffea0007452080 count:1 mapcount:0 mapping:ffff8801da800940 index:0x0 flags: 0x2fffc0000000100(slab) raw: 02fffc0000000100 ffffea0007451e48 ffffea00073c5bc8 ffff8801da800940 raw: 0000000000000000 ffff8801d1482000 0000000100000006 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801d1482400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d1482480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801d1482500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801d1482580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801d1482600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================