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

15 views
Skip to first unread message

syzbot

unread,
Apr 27, 2019, 1:13:07 PM4/27/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: fa5941f4 Linux 4.14.114
git tree: linux-4.14.y
console output: https://syzkaller.appspot.com/x/log.txt?x=100ede40a00000
kernel config: https://syzkaller.appspot.com/x/.config?x=d7780000df8e070e
dashboard link: https://syzkaller.appspot.com/bug?extid=49e4614fdbd32d63c7ad
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

Unfortunately, I don't have any reproducer for this crash yet.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+49e461...@syzkaller.appspotmail.com

loop2: rw=1, want=26693, limit=112
attempt to access beyond end of device
loop2: rw=1, want=26702, limit=112
==================================================================
attempt to access beyond end of device
BUG: KASAN: stack-out-of-bounds in memcpy include/linux/string.h:347
[inline]
BUG: KASAN: stack-out-of-bounds in __ip_options_echo+0x269/0xfb0
net/ipv4/ip_options.c:123
Write of size 69 at addr ffff8880aef07b80 by task swapper/1/0

CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.14.114 #4
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS
Google 01/01/2011
Call Trace:
<IRQ>
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x138/0x19c lib/dump_stack.c:53
print_address_description.cold+0x7c/0x1dc mm/kasan/report.c:252
kasan_report_error mm/kasan/report.c:351 [inline]
kasan_report mm/kasan/report.c:409 [inline]
kasan_report.cold+0xaf/0x2b5 mm/kasan/report.c:393
check_memory_region_inline mm/kasan/kasan.c:260 [inline]
check_memory_region+0x123/0x190 mm/kasan/kasan.c:267
loop2: rw=1, want=26703, limit=112
memcpy+0x38/0x50 mm/kasan/kasan.c:303
memcpy include/linux/string.h:347 [inline]
__ip_options_echo+0x269/0xfb0 net/ipv4/ip_options.c:123
__icmp_send+0x668/0x11f0 net/ipv4/icmp.c:698
attempt to access beyond end of device
loop2: rw=1, want=26704, limit=112
ipv4_link_failure+0x233/0x460 net/ipv4/route.c:1213
attempt to access beyond end of device
loop2: rw=1, want=26705, limit=112
dst_link_failure include/net/dst.h:442 [inline]
arp_error_report+0xb1/0x190 net/ipv4/arp.c:297
neigh_invalidate+0x233/0x540 net/core/neighbour.c:891
neigh_timer_handler+0x851/0xa80 net/core/neighbour.c:977
attempt to access beyond end of device
call_timer_fn+0x164/0x680 kernel/time/timer.c:1279
expire_timers kernel/time/timer.c:1318 [inline]
__run_timers kernel/time/timer.c:1634 [inline]
__run_timers kernel/time/timer.c:1602 [inline]
run_timer_softirq+0x5b4/0x1570 kernel/time/timer.c:1647
__do_softirq+0x24e/0x9ae kernel/softirq.c:288
invoke_softirq kernel/softirq.c:368 [inline]
irq_exit+0x160/0x1b0 kernel/softirq.c:409
exiting_irq arch/x86/include/asm/apic.h:648 [inline]
smp_apic_timer_interrupt+0x156/0x600 arch/x86/kernel/apic/apic.c:1064
apic_timer_interrupt+0x8e/0xa0 arch/x86/entry/entry_64.S:787
</IRQ>
RIP: 0010:native_safe_halt+0x2/0x10 arch/x86/include/asm/irqflags.h:58
RSP: 0018:ffff8880a9d2fe70 EFLAGS: 00000282 ORIG_RAX: ffffffffffffff10
RAX: 1ffffffff0ee2970 RBX: ffff8880a9d1c340 RCX: 0000000000000000
RDX: dffffc0000000000 RSI: 0000000000000001 RDI: ffff8880a9d1cbbc
RBP: ffff8880a9d2fe98 R08: 1ffffffff1049a01 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffffffff87714b70
R13: 0000000000000000 R14: 0000000000000000 R15: ffff8880a9d1c340
arch_cpu_idle+0x10/0x20 arch/x86/kernel/process.c:557
loop2: rw=1, want=30377, limit=112
default_idle_call+0x36/0x90 kernel/sched/idle.c:98
cpuidle_idle_call kernel/sched/idle.c:156 [inline]
do_idle+0x262/0x3d0 kernel/sched/idle.c:246
cpu_startup_entry+0x1b/0x20 kernel/sched/idle.c:351
start_secondary+0x362/0x4d0 arch/x86/kernel/smpboot.c:272
secondary_startup_64+0xa5/0xb0 arch/x86/kernel/head_64.S:240

The buggy address belongs to the page:
page:ffffea0002bbc1c0 count:1 mapcount:0 mapping: (null) index:0x0
flags: 0x1fffc0000000800(reserved)
raw: 01fffc0000000800 0000000000000000 0000000000000000 00000001ffffffff
raw: ffffea0002bbc1e0 ffffea0002bbc1e0 0000000000000000 0000000000000000
page dumped because: kasan: bad access detected

Memory state around the buggy address:
ffff8880aef07a80: f2 f2 f2 00 00 00 00 f2 f2 f2 f2 00 00 00 00 00
ffff8880aef07b00: 00 00 f2 f2 f2 f2 f2 00 00 00 00 00 00 00 00 00
> ffff8880aef07b80: 00 00 00 00 00 f3 f3 f3 f3 00 00 00 00 00 00 00
^
ffff8880aef07c00: 00 f1 f1 f1 f1 00 00 f3 f3 00 00 00 00 00 00 00
ffff8880aef07c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================


---
This bug is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this bug report. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

syzbot

unread,
Apr 28, 2019, 7:26:06 PM4/28/19
to syzkaller...@googlegroups.com
Hello,

syzbot found the following crash on:

HEAD commit: 19bb613a Linux 4.19.37
git tree: linux-4.19.y
console output: https://syzkaller.appspot.com/x/log.txt?x=109271a8a00000
kernel config: https://syzkaller.appspot.com/x/.config?x=2f4f1677ff80cdff
dashboard link: https://syzkaller.appspot.com/bug?extid=ce03b5a32e44375bf507
compiler: gcc (GCC) 9.0.0 20181231 (experimental)

Unfortunately, I don't have any reproducer for this crash yet.

IMPORTANT: if you fix the bug, please add the following tag to the commit:
Reported-by: syzbot+ce03b5...@syzkaller.appspotmail.com

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

syzbot

unread,
Oct 24, 2019, 12:14:07 PM10/24/19
to syzkaller...@googlegroups.com
Auto-closing this bug as obsolete.
Crashes did not happen for a while, no reproducer and no activity.

syzbot

unread,
Oct 25, 2019, 4:39:07 AM10/25/19
to syzkaller...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages