syzbot


KASAN: stack-out-of-bounds Write in __ip_options_echo

Status: auto-closed as invalid on 2019/10/25 08:39
Reported-by: syzbot+ce03b5a32e44375bf507@syzkaller.appspotmail.com
First crash: 1796d, last: 1796d
Similar bugs (3)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.14 KASAN: stack-out-of-bounds Write in __ip_options_echo 1 1797d 1797d 0/1 auto-closed as invalid on 2019/10/24 16:14
upstream KASAN: stack-out-of-bounds Write in __ip_options_echo net syz done 8 1801d 1805d 12/26 fixed on 2019/05/27 12:48
upstream KASAN: stack-out-of-bounds Write in __ip_options_echo (2) net 1 869d 869d 0/26 closed as invalid on 2021/12/14 20:02

Sample crash report:
overlayfs: filesystem on './file0' not supported as upperdir
==================================================================
BUG: KASAN: stack-out-of-bounds in memcpy include/linux/string.h:348 [inline]
BUG: KASAN: stack-out-of-bounds in __ip_options_echo+0x294/0x1120 net/ipv4/ip_options.c:123
Write of size 69 at addr ffff8880566570b8 by task syz-executor.4/14174

CPU: 1 PID: 14174 Comm: syz-executor.4 Not tainted 4.19.37 #5
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+0x7c/0x20d mm/kasan/report.c:256
 kasan_report_error mm/kasan/report.c:354 [inline]
 kasan_report mm/kasan/report.c:412 [inline]
 kasan_report.cold+0x8c/0x2ba mm/kasan/report.c:396
 check_memory_region_inline mm/kasan/kasan.c:260 [inline]
 check_memory_region+0x123/0x190 mm/kasan/kasan.c:267
 memcpy+0x38/0x50 mm/kasan/kasan.c:303
 memcpy include/linux/string.h:348 [inline]
 __ip_options_echo+0x294/0x1120 net/ipv4/ip_options.c:123
 __icmp_send+0x72e/0x1410 net/ipv4/icmp.c:695
 ipv4_link_failure+0x29f/0x550 net/ipv4/route.c:1206
 dst_link_failure include/net/dst.h:427 [inline]
 vti6_xmit net/ipv6/ip6_vti.c:514 [inline]
 vti6_tnl_xmit+0x10f9/0x1c8c net/ipv6/ip6_vti.c:553
 __netdev_start_xmit include/linux/netdevice.h:4303 [inline]
 netdev_start_xmit include/linux/netdevice.h:4312 [inline]
 xmit_one net/core/dev.c:3257 [inline]
 dev_hard_start_xmit+0x1aa/0x980 net/core/dev.c:3273
 __dev_queue_xmit+0x2718/0x3020 net/core/dev.c:3843
 dev_queue_xmit+0x18/0x20 net/core/dev.c:3876
 neigh_direct_output+0x16/0x20 net/core/neighbour.c:1406
 neigh_output include/net/neighbour.h:501 [inline]
 ip_finish_output2+0x949/0x1750 net/ipv4/ip_output.c:229
 ip_finish_output+0x742/0xd20 net/ipv4/ip_output.c:317
 NF_HOOK_COND include/linux/netfilter.h:278 [inline]
 ip_output+0x225/0x670 net/ipv4/ip_output.c:405
 dst_output include/net/dst.h:444 [inline]
 NF_HOOK include/linux/netfilter.h:289 [inline]
 raw_send_hdrinc net/ipv4/raw.c:433 [inline]
 raw_sendmsg+0x1d26/0x2bc0 net/ipv4/raw.c:664
 inet_sendmsg+0x147/0x5d0 net/ipv4/af_inet.c:798
 sock_sendmsg_nosec net/socket.c:622 [inline]
 sock_sendmsg+0xdd/0x130 net/socket.c:632
 sock_write_iter+0x27c/0x3e0 net/socket.c:901
 call_write_iter include/linux/fs.h:1811 [inline]
 new_sync_write fs/read_write.c:474 [inline]
 __vfs_write+0x58e/0x820 fs/read_write.c:487
 vfs_write+0x20c/0x560 fs/read_write.c:549
 ksys_write+0xea/0x1f0 fs/read_write.c:598
 __do_sys_write fs/read_write.c:610 [inline]
 __se_sys_write fs/read_write.c:607 [inline]
 __x64_sys_write+0x73/0xb0 fs/read_write.c:607
 do_syscall_64+0x103/0x610 arch/x86/entry/common.c:290
 entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x458da9
Code: ad b8 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 7b b8 fb ff c3 66 2e 0f 1f 84 00 00 00 00
RSP: 002b:00007f23c7d66c78 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000000458da9
RDX: 0000000000000074 RSI: 0000000020000340 RDI: 0000000000000003
RBP: 000000000073bf00 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007f23c7d676d4
R13: 00000000004c87a3 R14: 00000000004deee8 R15: 00000000ffffffff

The buggy address belongs to the page:
page:ffffea00015995c0 count:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x1fffc0000000000()
raw: 01fffc0000000000 0000000000000000 ffffffff01590101 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
 ffff888056656f80: f1 f1 01 f2 00 f2 f2 f2 00 00 00 00 00 f2 f2 f2
 ffff888056657000: f2 f2 00 00 00 00 00 00 00 f2 f2 f2 f2 f2 00 00
>ffff888056657080: 00 00 00 00 00 00 00 00 00 00 00 00 f3 f3 f3 f3
                                                       ^
 ffff888056657100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1
 ffff888056657180: f1 f1 00 00 f3 f3 00 00 00 00 00 00 00 00 00 00
==================================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2019/04/28 22:25 linux-4.19.y 19bb613acb9a b617407b .config console log report ci2-linux-4-19
* Struck through repros no longer work on HEAD.