Re: WARNING in fpu__copy

From: Eric Biggers
Date: Tue Jan 30 2018 - 18:19:22 EST


On Tue, Dec 19, 2017 at 11:49:02PM -0800, syzbot wrote:
> Hello,
>
> syzkaller hit the following crash on
> 6084b576dca2e898f5c101baef151f7bfdbb606d
> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/master
> compiler: gcc (GCC) 7.1.1 20170620
> .config is attached
> Raw console output is attached.
>
> Unfortunately, I don't have any reproducer for this bug yet.
>
>
> netlink: 'syz-executor4': attribute type 2 has an invalid length.
> device gre0 entered promiscuous mode
> WARNING: CPU: 1 PID: 7913 at ./arch/x86/include/asm/fpu/internal.h:340
> copy_xregs_to_kernel arch/x86/include/asm/fpu/internal.h:340 [inline]
> WARNING: CPU: 1 PID: 7913 at ./arch/x86/include/asm/fpu/internal.h:340
> copy_fpregs_to_fpstate arch/x86/include/asm/fpu/internal.h:413 [inline]
> WARNING: CPU: 1 PID: 7913 at ./arch/x86/include/asm/fpu/internal.h:340
> fpu__copy+0x385/0x390 arch/x86/kernel/fpu/core.c:212
> Kernel panic - not syncing: panic_on_warn set ...
>
> CPU: 1 PID: 7913 Comm: syz-executor2 Not tainted 4.15.0-rc3-next-20171214+
> #67
> 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+0xe9/0x14b lib/dump_stack.c:53
> panic+0x10e/0x2f8 kernel/panic.c:183
> __warn+0x14e/0x150 kernel/panic.c:547
> report_bug+0x11e/0x1a0 lib/bug.c:184
> fixup_bug.part.11+0x17/0x30 arch/x86/kernel/traps.c:177
> fixup_bug arch/x86/kernel/traps.c:246 [inline]
> do_error_trap+0x14a/0x180 arch/x86/kernel/traps.c:295
> do_invalid_op+0x1b/0x20 arch/x86/kernel/traps.c:314
> invalid_op+0x22/0x40 arch/x86/entry/entry_64.S:1079
> RIP: 0010:copy_xregs_to_kernel arch/x86/include/asm/fpu/internal.h:340
> [inline]
> RIP: 0010:copy_fpregs_to_fpstate arch/x86/include/asm/fpu/internal.h:413
> [inline]
> RIP: 0010:fpu__copy+0x385/0x390 arch/x86/kernel/fpu/core.c:212
> RSP: 0018:ffffc90000dc7d18 EFLAGS: 00010293
> RAX: ffff88021516c380 RBX: ffff8801e1735580 RCX: ffffffff810d6e85
> RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8801e17355c0
> RBP: ffffc90000dc7d38 R08: 000000000002dd38 R09: ffff8801e17355c0
> R10: 0000000000000000 R11: 0000000000000000 R12: ffff88021516d780
> R13: ffff8801e17355c0 R14: ffffc90000d94000 R15: ffff8801de73ea00
> arch_dup_task_struct+0x27/0x30 arch/x86/kernel/process.c:100
> dup_task_struct kernel/fork.c:786 [inline]
> copy_process.part.35+0x161/0x2240 kernel/fork.c:1639
> copy_process kernel/fork.c:1614 [inline]
> _do_fork+0x122/0x880 kernel/fork.c:2095
> SYSC_clone kernel/fork.c:2202 [inline]
> SyS_clone+0x37/0x50 kernel/fork.c:2196
> do_syscall_64+0x7f/0x270 arch/x86/entry/common.c:285
> entry_SYSCALL64_slow_path+0x25/0x25
> RIP: 0033:0x455399
> RSP: 002b:0000000000a2f748 EFLAGS: 00000202 ORIG_RAX: 0000000000000038
> RAX: ffffffffffffffda RBX: 00007fcf3c9d9700 RCX: 0000000000455399
> RDX: 00007fcf3c9d99d0 RSI: 00007fcf3c9d8db0 RDI: 00000000003d0f00
> RBP: 0000000000a2f880 R08: 00007fcf3c9d9700 R09: 00007fcf3c9d9700
> R10: 00007fcf3c9d99d0 R11: 0000000000000202 R12: 0000000000000000
> R13: 0000000000a2f7ff R14: 00007fcf3c9d99c0 R15: 0000000000000002
> Dumping ftrace buffer:
> (ftrace buffer empty)
> Kernel Offset: disabled
> Rebooting in 86400 seconds..
>
>
> ---
> This bug is generated by a dumb bot. It may contain errors.
> See https://goo.gl/tpsmEJ for details.
> Direct all questions to syzkaller@xxxxxxxxxxxxxxxxx
> Please credit me with: Reported-by: syzbot <syzkaller@xxxxxxxxxxxxxxxx>
>
> syzbot will keep track of this bug report.
> Once a fix for this bug is merged into any tree, reply to this email with:
> #syz fix: exact-commit-title

This last occurred on 10a7e9d849150a2879efc0b04d8a51068c9dd0c5 which was missing
commit 5663d8f9bbe4, so I'm guessing that fixed it:

#syz fix: kvm: x86: fix WARN due to uninitialized guest FPU state