syzbot
KASAN: stack-out-of-bounds Write in ipip6_tunnel_locate
Status: fixed on 2018/05/08 18:30
Subsystems:
net
[Documentation on labels]
Fix commit:
b95211e066fc
ipv6: sit: better validate user provided tunnel names
First crash: 3032d, last: 3025d
Sample crash report:
==================================================================
BUG: KASAN: stack-out-of-bounds in strlcpy include/linux/string.h:300 [inline]
BUG: KASAN: stack-out-of-bounds in ipip6_tunnel_locate+0x63b/0xaa0 net/ipv6/sit.c:254
Write of size 33 at addr ffff8801b64076d8 by task syzkaller932654/4453
CPU: 0 PID: 4453 Comm: syzkaller932654 Not tainted 4.16.0+ #1
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
__dump_stack lib/dump_stack.c:17 [inline]
dump_stack+0x1b9/0x29f lib/dump_stack.c:53
print_address_description+0x6c/0x20b mm/kasan/report.c:256
kasan_report_error mm/kasan/report.c:354 [inline]
kasan_report.cold.7+0xac/0x2f5 mm/kasan/report.c:412
check_memory_region_inline mm/kasan/kasan.c:260 [inline]
check_memory_region+0x13e/0x1b0 mm/kasan/kasan.c:267
memcpy+0x37/0x50 mm/kasan/kasan.c:303
strlcpy include/linux/string.h:300 [inline]
ipip6_tunnel_locate+0x63b/0xaa0 net/ipv6/sit.c:254
ipip6_tunnel_ioctl+0xe71/0x241b net/ipv6/sit.c:1221
dev_ifsioc+0x43e/0xb90 net/core/dev_ioctl.c:334
dev_ioctl+0x69a/0xcc0 net/core/dev_ioctl.c:525
sock_ioctl+0x47e/0x680 net/socket.c:1015
vfs_ioctl fs/ioctl.c:46 [inline]
file_ioctl fs/ioctl.c:500 [inline]
do_vfs_ioctl+0x1cf/0x1650 fs/ioctl.c:684
ksys_ioctl+0xa9/0xd0 fs/ioctl.c:701
SYSC_ioctl fs/ioctl.c:708 [inline]
SyS_ioctl+0x24/0x30 fs/ioctl.c:706
do_syscall_64+0x29e/0x9d0 arch/x86/entry/common.c:287
entry_SYSCALL_64_after_hwframe+0x42/0xb7
RIP: 0033:0x43fe09
RSP: 002b:00007fff1291df58 EFLAGS: 00000213 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00000000004002c8 RCX: 000000000043fe09
RDX: 00000000200001c0 RSI: 00000000000089f1 RDI: 0000000000000003
RBP: 00000000006ca018 R08: 000000000000001c R09: 00000000004002c8
R10: 000000000000001c R11: 0000000000000213 R12: 0000000000401730
R13: 00000000004017c0 R14: 0000000000000000 R15: 0000000000000000
The buggy address belongs to the page:
page:ffffea0006d901c0 count:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x2fffc0000000000()
raw: 02fffc0000000000 0000000000000000 0000000000000000 00000000ffffffff
raw: 0000000000000000 ffffea0006d90101 0000000000000000 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff8801b6407580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8801b6407600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1
>ffff8801b6407680: f1 f1 f1 f8 f2 f2 f2 f2 f2 f2 f2 00 00 f2 f2 00
^
ffff8801b6407700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8801b6407780: 00 00 f1 f1 f1 f1 f8 f2 f2 f2 f2 f2 f2 f2 00 f2
==================================================================
* Struck through repros no longer work on HEAD.