================================================================== BUG: KASAN: slab-out-of-bounds in tcp_zerocopy_receive net/ipv4/tcp.c:1807 [inline] BUG: KASAN: slab-out-of-bounds in do_tcp_getsockopt.isra.0+0x2c6c/0x3120 net/ipv4/tcp.c:3654 Read of size 4 at addr ffff8880943cf188 by task syz-executor.2/17508 CPU: 0 PID: 17508 Comm: syz-executor.2 Not tainted 5.3.0-rc7+ #0 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+0x172/0x1f0 lib/dump_stack.c:113 print_address_description.cold+0xd4/0x306 mm/kasan/report.c:351 __kasan_report.cold+0x1b/0x36 mm/kasan/report.c:482 kasan_report+0x12/0x17 mm/kasan/common.c:618 __asan_report_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131 tcp_zerocopy_receive net/ipv4/tcp.c:1807 [inline] do_tcp_getsockopt.isra.0+0x2c6c/0x3120 net/ipv4/tcp.c:3654 tcp_getsockopt+0xbf/0xe0 net/ipv4/tcp.c:3680 sock_common_getsockopt+0x94/0xd0 net/core/sock.c:3098 __sys_getsockopt+0x16d/0x310 net/socket.c:2129 __do_sys_getsockopt net/socket.c:2144 [inline] __se_sys_getsockopt net/socket.c:2141 [inline] __x64_sys_getsockopt+0xbe/0x150 net/socket.c:2141 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x459879 Code: fd b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 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 0f 83 cb b7 fb ff c3 66 2e 0f 1f 84 00 00 00 00 RSP: 002b:00007fd04b2f5c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000037 RAX: ffffffffffffffda RBX: 0000000000000005 RCX: 0000000000459879 RDX: 0000000000000023 RSI: 0000000000000006 RDI: 0000000000000003 RBP: 000000000075bfc8 R08: 0000000020000040 R09: 0000000000000000 R10: 0000000020000000 R11: 0000000000000246 R12: 00007fd04b2f66d4 R13: 00000000004ccf68 R14: 00000000004d39b8 R15: 00000000ffffffff Allocated by task 17504: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc mm/kasan/common.c:493 [inline] __kasan_kmalloc.constprop.0+0xcf/0xe0 mm/kasan/common.c:466 kasan_kmalloc+0x9/0x10 mm/kasan/common.c:507 __do_kmalloc_node mm/slab.c:3615 [inline] __kmalloc_node_track_caller+0x4e/0x70 mm/slab.c:3629 __kmalloc_reserve.isra.0+0x40/0xf0 net/core/skbuff.c:141 __alloc_skb+0x10b/0x5e0 net/core/skbuff.c:209 alloc_skb_fclone include/linux/skbuff.h:1093 [inline] sk_stream_alloc_skb+0x2d2/0xc60 net/ipv4/tcp.c:875 tcp_sendmsg_locked+0xc70/0x31d0 net/ipv4/tcp.c:1283 tcp_sendmsg+0x30/0x50 net/ipv4/tcp.c:1434 inet_sendmsg+0x9e/0xe0 net/ipv4/af_inet.c:807 sock_sendmsg_nosec net/socket.c:637 [inline] sock_sendmsg+0xd7/0x130 net/socket.c:657 sock_write_iter+0x27c/0x3e0 net/socket.c:989 call_write_iter include/linux/fs.h:1870 [inline] new_sync_write+0x4d3/0x770 fs/read_write.c:483 __vfs_write+0xe1/0x110 fs/read_write.c:496 vfs_write+0x268/0x5d0 fs/read_write.c:558 ksys_write+0x14f/0x290 fs/read_write.c:611 __do_sys_write fs/read_write.c:623 [inline] __se_sys_write fs/read_write.c:620 [inline] __x64_sys_write+0x73/0xb0 fs/read_write.c:620 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8741: save_stack+0x23/0x90 mm/kasan/common.c:69 set_track mm/kasan/common.c:77 [inline] __kasan_slab_free+0x102/0x150 mm/kasan/common.c:455 kasan_slab_free+0xe/0x10 mm/kasan/common.c:463 __cache_free mm/slab.c:3425 [inline] kfree+0x10a/0x2c0 mm/slab.c:3756 skb_free_head+0x93/0xb0 net/core/skbuff.c:591 skb_release_data+0x42d/0x7c0 net/core/skbuff.c:611 skb_release_all+0x4d/0x60 net/core/skbuff.c:665 __kfree_skb net/core/skbuff.c:679 [inline] consume_skb net/core/skbuff.c:838 [inline] consume_skb+0xfb/0x3b0 net/core/skbuff.c:832 skb_free_datagram+0x1b/0x100 net/core/datagram.c:328 netlink_recvmsg+0x6c6/0xf50 net/netlink/af_netlink.c:1996 sock_recvmsg_nosec net/socket.c:871 [inline] sock_recvmsg net/socket.c:889 [inline] sock_recvmsg+0xce/0x110 net/socket.c:885 ___sys_recvmsg+0x271/0x5a0 net/socket.c:2480 __sys_recvmsg+0x102/0x1d0 net/socket.c:2537 __do_sys_recvmsg net/socket.c:2547 [inline] __se_sys_recvmsg net/socket.c:2544 [inline] __x64_sys_recvmsg+0x78/0xb0 net/socket.c:2544 do_syscall_64+0xfd/0x6a0 arch/x86/entry/common.c:296 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880943ced80 which belongs to the cache kmalloc-1k of size 1024 The buggy address is located 8 bytes to the right of 1024-byte region [ffff8880943ced80, ffff8880943cf180) The buggy address belongs to the page: page:ffffea000250f380 refcount:1 mapcount:0 mapping:ffff8880aa400c40 index:0xffff8880943cfb00 compound_mapcount: 0 flags: 0x1fffc0000010200(slab|head) raw: 01fffc0000010200 ffffea000286af08 ffffea0002325f88 ffff8880aa400c40 raw: ffff8880943cfb00 ffff8880943ce000 0000000100000004 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880943cf080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880943cf100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880943cf180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880943cf200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880943cf280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================