android_kernel_samsung_a7y1.../arch/x86
Paolo Bonzini a0abec7731 kvm: x86: avoid warning on repeated KVM_SET_TSS_ADDR
commit b21629da120dd6145d14dbd6d028e1bba680a92b upstream.

Found by syzkaller:

    WARNING: CPU: 3 PID: 15175 at arch/x86/kvm/x86.c:7705 __x86_set_memory_region+0x1dc/0x1f0 [kvm]()
    CPU: 3 PID: 15175 Comm: a.out Tainted: G        W       4.4.6-300.fc23.x86_64 #1
    Hardware name: LENOVO 2325F51/2325F51, BIOS G2ET32WW (1.12 ) 05/30/2012
     0000000000000286 00000000950899a7 ffff88011ab3fbf0 ffffffff813b542e
     0000000000000000 ffffffffa0966496 ffff88011ab3fc28 ffffffff810a40f2
     00000000000001fd 0000000000003000 ffff88014fc50000 0000000000000000
    Call Trace:
     [<ffffffff813b542e>] dump_stack+0x63/0x85
     [<ffffffff810a40f2>] warn_slowpath_common+0x82/0xc0
     [<ffffffff810a423a>] warn_slowpath_null+0x1a/0x20
     [<ffffffffa09251cc>] __x86_set_memory_region+0x1dc/0x1f0 [kvm]
     [<ffffffffa092521b>] x86_set_memory_region+0x3b/0x60 [kvm]
     [<ffffffffa09bb61c>] vmx_set_tss_addr+0x3c/0x150 [kvm_intel]
     [<ffffffffa092f4d4>] kvm_arch_vm_ioctl+0x654/0xbc0 [kvm]
     [<ffffffffa091d31a>] kvm_vm_ioctl+0x9a/0x6f0 [kvm]
     [<ffffffff81241248>] do_vfs_ioctl+0x298/0x480
     [<ffffffff812414a9>] SyS_ioctl+0x79/0x90
     [<ffffffff817a04ee>] entry_SYSCALL_64_fastpath+0x12/0x71

Testcase:

    #include <unistd.h>
    #include <sys/ioctl.h>
    #include <fcntl.h>
    #include <string.h>
    #include <linux/kvm.h>

    long r[8];

    int main()
    {
        memset(r, -1, sizeof(r));
	r[2] = open("/dev/kvm", O_RDONLY|O_TRUNC);
        r[3] = ioctl(r[2], KVM_CREATE_VM, 0x0ul);
        r[5] = ioctl(r[3], KVM_SET_TSS_ADDR, 0x20000000ul);
        r[7] = ioctl(r[3], KVM_SET_TSS_ADDR, 0x20000000ul);
        return 0;
    }

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Cc: Zubin Mithra <zsm@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-06 19:31:12 +02:00
..
boot x86/build: Specify elf_i386 linker emulation explicitly for i386 objects 2020-04-06 14:56:37 +02:00
configs A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
crypto crypto: x86/crct10dif-pcl - fix use via crypto_shash_digest() 2020-04-06 18:12:16 +02:00
entry x86/speculation/mds: Clear CPU buffers on exit to user 2020-04-06 16:55:38 +02:00
ia32 x86/ia32: Fix ia32_restore_sigcontext() AC leak 2020-04-06 18:19:56 +02:00
include x86/speculation/mds: Add mitigation mode VMWERV 2020-04-06 16:55:51 +02:00
kernel x86/tls: Fix possible spectre-v1 in do_get_thread_area() 2020-04-06 19:26:28 +02:00
kvm kvm: x86: avoid warning on repeated KVM_SET_TSS_ADDR 2020-04-06 19:31:12 +02:00
lguest A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
lib A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
math-emu A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mm x86/mm: Remove in_nmi() warning from 64-bit implementation of vmalloc_fault() 2020-04-06 18:18:27 +02:00
net A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
oprofile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pci x86/PCI: Fix PCI IRQ routing table memory leak 2020-04-06 19:02:09 +02:00
platform A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
power A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
purgatory A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ras A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
realmode x86/build: Specify elf_i386 linker emulation explicitly for i386 objects 2020-04-06 14:56:37 +02:00
tools A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
um um: Compile with modern headers 2020-04-06 19:17:39 +02:00
video A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
xen A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kbuild A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig x86/Kconfig: Select SCHED_SMT if SMP enabled 2020-04-06 16:50:59 +02:00
Kconfig.cpu A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig.debug A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile x86/build: Keep local relocations with ld.lld 2020-04-06 18:19:33 +02:00
Makefile_32.cpu A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile.um A750FXXU4CTBC 2020-03-27 21:51:54 +05:30