kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* kvm: WARNING in em_jmp_far
@ 2016-11-15  5:06 Dmitry Vyukov
  2016-11-15  5:24 ` Nadav Amit
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Vyukov @ 2016-11-15  5:06 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, x86@kernel.org, KVM list, LKML,
	Steve Rutherford
  Cc: syzkaller

Hello,

The following program triggers WARNING in em_jmp_far:
https://gist.githubusercontent.com/dvyukov/16bfd3d68fa7d5461101ef74e07796e4/raw/e6d663980681f2c5838ff6cd361cede7d3204838/gistfile1.txt


WARNING: CPU: 1 PID: 15748 at arch/x86/kvm/emulate.c:2128 em_jmp_far+0x4a7/0x530
Kernel panic - not syncing: panic_on_warn set ...

CPU: 1 PID: 15748 Comm: syz-executor Not tainted 4.9.0-rc5+ #28
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
 ffff880033986ec8 ffffffff834c2959 ffffffff00000001 1ffff10006730d6c
 ffffed0006730d64 0000000041b58ab3 ffffffff89575430 ffffffff834c266b
 0000000041b58ab3 ffffffff894d1810 ffffffff8158f020 ffffffff811ac787
Call Trace:
 [<     inline     >] __dump_stack lib/dump_stack.c:15
 [<ffffffff834c2959>] dump_stack+0x2ee/0x3f5 lib/dump_stack.c:51
 [<ffffffff81848908>] panic+0x200/0x425 kernel/panic.c:179
 [<ffffffff813fc919>] __warn+0x1c9/0x1e0 kernel/panic.c:542
 [<ffffffff813fcb81>] warn_slowpath_null+0x31/0x40 kernel/panic.c:585
 [<ffffffff81157867>] em_jmp_far+0x4a7/0x530 arch/x86/kvm/emulate.c:2128
 [<ffffffff811614ef>] x86_emulate_insn+0x43f/0x4090 arch/x86/kvm/emulate.c:5294
 [<ffffffff810e121e>] x86_emulate_instruction+0x43e/0x2300
arch/x86/kvm/x86.c:5547
 [<     inline     >] emulate_instruction arch/x86/include/asm/kvm_host.h:1116
 [<     inline     >] complete_emulated_io arch/x86/kvm/x86.c:6872
 [<ffffffff810e384e>] complete_emulated_mmio+0x76e/0xb70 arch/x86/kvm/x86.c:6936
 [<ffffffff810f1c92>] kvm_arch_vcpu_ioctl_run+0x3562/0x4eb0
arch/x86/kvm/x86.c:6980
 [<ffffffff8107b328>] kvm_vcpu_ioctl+0x678/0x11c0
arch/x86/kvm/../../../virt/kvm/kvm_main.c:2557
 [<     inline     >] vfs_ioctl fs/ioctl.c:43
 [<ffffffff81abcb44>] do_vfs_ioctl+0x1c4/0x1630 fs/ioctl.c:679
 [<     inline     >] SYSC_ioctl fs/ioctl.c:694
 [<ffffffff81abe044>] SyS_ioctl+0x94/0xc0 fs/ioctl.c:685
 [<ffffffff88143885>] entry_SYSCALL_64_fastpath+0x23/0xc6
Dumping ftrace buffer:
   (ftrace buffer empty)
Kernel Offset: disabled
reboot: cpu_has_vmx: ecx=80a02021 1

On commit a25f0944ba9b1d8a6813fd6f1a86f1bd59ac25a6 (Nov 13).

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: kvm: WARNING in em_jmp_far
  2016-11-15  5:06 kvm: WARNING in em_jmp_far Dmitry Vyukov
@ 2016-11-15  5:24 ` Nadav Amit
  2016-11-15  5:30   ` Dmitry Vyukov
  0 siblings, 1 reply; 5+ messages in thread
From: Nadav Amit @ 2016-11-15  5:24 UTC (permalink / raw)
  To: Dmitry Vyukov
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86@kernel.org,
	KVM list, LKML, Steve Rutherford, syzkaller, Paolo Bonzini,
	Radim Krčmář

 
> On Nov 14, 2016, at 9:06 PM, Dmitry Vyukov <dvyukov@google.com> wrote:
> 
> Hello,
> 
> The following program triggers WARNING in em_jmp_far:
> https://gist.githubusercontent.com/dvyukov/16bfd3d68fa7d5461101ef74e07796e4/raw/e6d663980681f2c5838ff6cd361cede7d3204838/gistfile1.txt
> 
> 
> WARNING: CPU: 1 PID: 15748 at arch/x86/kvm/emulate.c:2128 em_jmp_far+0x4a7/0x530

I don’t know how to “read” the test, but it seems that this warning
can be triggered if CS base/limit cause a #GP exception when EIP
is loaded.

I think it safe to remove this warning (which I introduced) as well as
the redundant “return rc” that follows it. The code should handle the
emulation correctly regardless of the warning.

Regards,
Nadav

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: kvm: WARNING in em_jmp_far
  2016-11-15  5:24 ` Nadav Amit
@ 2016-11-15  5:30   ` Dmitry Vyukov
  2016-11-15  5:39     ` Nadav Amit
  0 siblings, 1 reply; 5+ messages in thread
From: Dmitry Vyukov @ 2016-11-15  5:30 UTC (permalink / raw)
  To: syzkaller
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86@kernel.org,
	KVM list, LKML, Steve Rutherford, Paolo Bonzini,
	Radim Krčmář

On Tue, Nov 15, 2016 at 6:24 AM, Nadav Amit <nadav.amit@gmail.com> wrote:
>
>> On Nov 14, 2016, at 9:06 PM, Dmitry Vyukov <dvyukov@google.com> wrote:
>>
>> Hello,
>>
>> The following program triggers WARNING in em_jmp_far:
>> https://gist.githubusercontent.com/dvyukov/16bfd3d68fa7d5461101ef74e07796e4/raw/e6d663980681f2c5838ff6cd361cede7d3204838/gistfile1.txt
>>
>>
>> WARNING: CPU: 1 PID: 15748 at arch/x86/kvm/emulate.c:2128 em_jmp_far+0x4a7/0x530
>
> I don’t know how to “read” the test, but it seems that this warning
> can be triggered if CS base/limit cause a #GP exception when EIP
> is loaded.
>
> I think it safe to remove this warning (which I introduced) as well as
> the redundant “return rc” that follows it. The code should handle the
> emulation correctly regardless of the warning.

There was also a similar WARNING in em_ret_far:
https://groups.google.com/forum/#!msg/syzkaller/o5ZftARBhrs/r1ivQ-HtBgAJ

Please mail a fix and add a test.

Thanks

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: kvm: WARNING in em_jmp_far
  2016-11-15  5:30   ` Dmitry Vyukov
@ 2016-11-15  5:39     ` Nadav Amit
  2016-11-15 10:45       ` Paolo Bonzini
  0 siblings, 1 reply; 5+ messages in thread
From: Nadav Amit @ 2016-11-15  5:39 UTC (permalink / raw)
  To: Dmitry Vyukov
  Cc: syzkaller, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	x86@kernel.org, KVM list, LKML, Steve Rutherford, Paolo Bonzini,
	Radim Krčmář


> On Nov 14, 2016, at 9:30 PM, Dmitry Vyukov <dvyukov@google.com> wrote:
> 
> On Tue, Nov 15, 2016 at 6:24 AM, Nadav Amit <nadav.amit@gmail.com> wrote:
>> 
>>> On Nov 14, 2016, at 9:06 PM, Dmitry Vyukov <dvyukov@google.com> wrote:
>>> 
>>> Hello,
>>> 
>>> The following program triggers WARNING in em_jmp_far:
>>> https://gist.githubusercontent.com/dvyukov/16bfd3d68fa7d5461101ef74e07796e4/raw/e6d663980681f2c5838ff6cd361cede7d3204838/gistfile1.txt
>>> 
>>> 
>>> WARNING: CPU: 1 PID: 15748 at arch/x86/kvm/emulate.c:2128 em_jmp_far+0x4a7/0x530
>> 
>> I don’t know how to “read” the test, but it seems that this warning
>> can be triggered if CS base/limit cause a #GP exception when EIP
>> is loaded.
>> 
>> I think it safe to remove this warning (which I introduced) as well as
>> the redundant “return rc” that follows it. The code should handle the
>> emulation correctly regardless of the warning.
> 
> There was also a similar WARNING in em_ret_far:
> https://groups.google.com/forum/#!msg/syzkaller/o5ZftARBhrs/r1ivQ-HtBgAJ
> 
> Please mail a fix and add a test.

I am sorry, but I don’t think my current employer allows me to contribute
to KVM in such a manner.

Regards,
Nadav

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: kvm: WARNING in em_jmp_far
  2016-11-15  5:39     ` Nadav Amit
@ 2016-11-15 10:45       ` Paolo Bonzini
  0 siblings, 0 replies; 5+ messages in thread
From: Paolo Bonzini @ 2016-11-15 10:45 UTC (permalink / raw)
  To: Nadav Amit, Dmitry Vyukov
  Cc: syzkaller, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	x86@kernel.org, KVM list, LKML, Steve Rutherford,
	Radim Krčmář



On 15/11/2016 06:39, Nadav Amit wrote:
> 
>> On Nov 14, 2016, at 9:30 PM, Dmitry Vyukov <dvyukov@google.com> wrote:
>>
>> On Tue, Nov 15, 2016 at 6:24 AM, Nadav Amit <nadav.amit@gmail.com> wrote:
>>>
>>>> On Nov 14, 2016, at 9:06 PM, Dmitry Vyukov <dvyukov@google.com> wrote:
>>>>
>>>> Hello,
>>>>
>>>> The following program triggers WARNING in em_jmp_far:
>>>> https://gist.githubusercontent.com/dvyukov/16bfd3d68fa7d5461101ef74e07796e4/raw/e6d663980681f2c5838ff6cd361cede7d3204838/gistfile1.txt
>>>>
>>>>
>>>> WARNING: CPU: 1 PID: 15748 at arch/x86/kvm/emulate.c:2128 em_jmp_far+0x4a7/0x530
>>>
>>> I don’t know how to “read” the test, but it seems that this warning
>>> can be triggered if CS base/limit cause a #GP exception when EIP
>>> is loaded.
>>>
>>> I think it safe to remove this warning (which I introduced) as well as
>>> the redundant “return rc” that follows it. The code should handle the
>>> emulation correctly regardless of the warning.
>>
>> There was also a similar WARNING in em_ret_far:
>> https://groups.google.com/forum/#!msg/syzkaller/o5ZftARBhrs/r1ivQ-HtBgAJ
>>
>> Please mail a fix and add a test.
> 
> I am sorry, but I don’t think my current employer allows me to contribute
> to KVM in such a manner.

No problem, we can take care of it.

Paolo

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-15 10:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-15  5:06 kvm: WARNING in em_jmp_far Dmitry Vyukov
2016-11-15  5:24 ` Nadav Amit
2016-11-15  5:30   ` Dmitry Vyukov
2016-11-15  5:39     ` Nadav Amit
2016-11-15 10:45       ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).