================================================================== BUG: KASAN: use-after-free in ip_cmsg_recv_dstaddr net/ipv4/ip_sockglue.c:165 [inline] BUG: KASAN: use-after-free in ip_cmsg_recv_offset+0xcc6/0xde0 net/ipv4/ip_sockglue.c:228 Read of size 4 at addr ffff8801cf368020 by task syz-executor2/7698 CPU: 1 PID: 7698 Comm: syz-executor2 Not tainted 4.14.72+ #11 Call Trace: __dump_stack lib/dump_stack.c:17 [inline] dump_stack+0xb9/0x11b lib/dump_stack.c:53 print_address_description+0x60/0x22b mm/kasan/report.c:252 kasan_report_error mm/kasan/report.c:351 [inline] kasan_report.cold.6+0x11b/0x2dd mm/kasan/report.c:409 ip_cmsg_recv_dstaddr net/ipv4/ip_sockglue.c:165 [inline] ip_cmsg_recv_offset+0xcc6/0xde0 net/ipv4/ip_sockglue.c:228 ip_cmsg_recv include/net/ip.h:634 [inline] raw_recvmsg+0x552/0x6d0 net/ipv4/raw.c:791 inet_recvmsg+0x147/0x560 net/ipv4/af_inet.c:812 sock_recvmsg_nosec net/socket.c:818 [inline] sock_recvmsg+0xc0/0x100 net/socket.c:825 sock_read_iter+0x239/0x340 net/socket.c:902 call_read_iter include/linux/fs.h:1776 [inline] do_iter_readv_writev+0x473/0x560 fs/read_write.c:676 do_iter_read+0x212/0x580 fs/read_write.c:920 vfs_readv+0xe6/0x150 fs/read_write.c:984 do_readv+0xcc/0x240 fs/read_write.c:1017 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 RIP: 0033:0x457579 RSP: 002b:00007fd6cac35c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000013 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000457579 RDX: 0000000000000001 RSI: 0000000020000500 RDI: 0000000000000004 RBP: 000000000072bf00 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fd6cac366d4 R13: 00000000004c30b8 R14: 00000000004d4d10 R15: 00000000ffffffff Allocated by task 7698: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_kmalloc.part.1+0x4f/0xd0 mm/kasan/kasan.c:551 slab_post_alloc_hook mm/slab.h:442 [inline] slab_alloc_node mm/slub.c:2723 [inline] slab_alloc mm/slub.c:2731 [inline] __kmalloc_track_caller+0x104/0x300 mm/slub.c:4288 __kmalloc_reserve.isra.8+0x2f/0xc0 net/core/skbuff.c:137 __alloc_skb+0x105/0x550 net/core/skbuff.c:205 alloc_skb include/linux/skbuff.h:980 [inline] sock_wmalloc+0xa5/0xf0 net/core/sock.c:1927 __ip_append_data.isra.2+0x1983/0x2020 net/ipv4/ip_output.c:978 ip_append_data.part.4+0xd8/0x150 net/ipv4/ip_output.c:1173 ip_append_data+0x5a/0x80 net/ipv4/ip_output.c:1162 raw_sendmsg+0xa33/0x2470 net/ipv4/raw.c:663 inet_sendmsg+0x168/0x540 net/ipv4/af_inet.c:781 sock_sendmsg_nosec net/socket.c:645 [inline] sock_sendmsg+0xb5/0x100 net/socket.c:655 SYSC_sendto net/socket.c:1762 [inline] SyS_sendto+0x211/0x340 net/socket.c:1730 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 Freed by task 7698: save_stack mm/kasan/kasan.c:447 [inline] set_track mm/kasan/kasan.c:459 [inline] kasan_slab_free+0xac/0x190 mm/kasan/kasan.c:524 slab_free_hook mm/slub.c:1389 [inline] slab_free_freelist_hook mm/slub.c:1410 [inline] slab_free mm/slub.c:2966 [inline] kfree+0xf5/0x310 mm/slub.c:3897 skb_free_head+0x83/0xa0 net/core/skbuff.c:550 pskb_expand_head+0x553/0xb30 net/core/skbuff.c:1491 __pskb_pull_tail+0xca/0x1500 net/core/skbuff.c:1887 pskb_may_pull include/linux/skbuff.h:2116 [inline] ip_cmsg_recv_dstaddr net/ipv4/ip_sockglue.c:155 [inline] ip_cmsg_recv_offset+0xbe2/0xde0 net/ipv4/ip_sockglue.c:228 ip_cmsg_recv include/net/ip.h:634 [inline] raw_recvmsg+0x552/0x6d0 net/ipv4/raw.c:791 inet_recvmsg+0x147/0x560 net/ipv4/af_inet.c:812 sock_recvmsg_nosec net/socket.c:818 [inline] sock_recvmsg+0xc0/0x100 net/socket.c:825 sock_read_iter+0x239/0x340 net/socket.c:902 call_read_iter include/linux/fs.h:1776 [inline] do_iter_readv_writev+0x473/0x560 fs/read_write.c:676 do_iter_read+0x212/0x580 fs/read_write.c:920 vfs_readv+0xe6/0x150 fs/read_write.c:984 do_readv+0xcc/0x240 fs/read_write.c:1017 do_syscall_64+0x19b/0x4b0 arch/x86/entry/common.c:289 entry_SYSCALL_64_after_hwframe+0x42/0xb7 The buggy address belongs to the object at ffff8801cf368000 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 32 bytes inside of 512-byte region [ffff8801cf368000, ffff8801cf368200) The buggy address belongs to the page: page:ffffea00073cda00 count:1 mapcount:0 mapping: (null) index:0x0 compound_mapcount: 0 flags: 0x4000000000008100(slab|head) raw: 4000000000008100 0000000000000000 0000000000000000 00000001000c000c raw: ffffea00072b6200 0000000800000008 ffff8801da802c00 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8801cf367f00: fb fb fb fb fb fb fc fc fc fc fb fb fb fb fb fb ffff8801cf367f80: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc >ffff8801cf368000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8801cf368080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8801cf368100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================