android_kernel_sony_sdm845/include
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Wanpeng Li c781e3be97 KVM: Fix stack-out-of-bounds read in write_mmio
commit e39d200fa5bf5b94a0948db0dae44c1b73b84a56 upstream.

Reported by syzkaller:

  BUG: KASAN: stack-out-of-bounds in write_mmio+0x11e/0x270 [kvm]
  Read of size 8 at addr ffff8803259df7f8 by task syz-executor/32298

  CPU: 6 PID: 32298 Comm: syz-executor Tainted: G           OE    4.15.0-rc2+ #18
  Hardware name: LENOVO ThinkCentre M8500t-N000/SHARKBAY, BIOS FBKTC1AUS 02/16/2016
  Call Trace:
   dump_stack+0xab/0xe1
   print_address_description+0x6b/0x290
   kasan_report+0x28a/0x370
   write_mmio+0x11e/0x270 [kvm]
   emulator_read_write_onepage+0x311/0x600 [kvm]
   emulator_read_write+0xef/0x240 [kvm]
   emulator_fix_hypercall+0x105/0x150 [kvm]
   em_hypercall+0x2b/0x80 [kvm]
   x86_emulate_insn+0x2b1/0x1640 [kvm]
   x86_emulate_instruction+0x39a/0xb90 [kvm]
   handle_exception+0x1b4/0x4d0 [kvm_intel]
   vcpu_enter_guest+0x15a0/0x2640 [kvm]
   kvm_arch_vcpu_ioctl_run+0x549/0x7d0 [kvm]
   kvm_vcpu_ioctl+0x479/0x880 [kvm]
   do_vfs_ioctl+0x142/0x9a0
   SyS_ioctl+0x74/0x80
   entry_SYSCALL_64_fastpath+0x23/0x9a

The path of patched vmmcall will patch 3 bytes opcode 0F 01 C1(vmcall)
to the guest memory, however, write_mmio tracepoint always prints 8 bytes
through *(u64 *)val since kvm splits the mmio access into 8 bytes. This
leaks 5 bytes from the kernel stack (CVE-2017-17741).  This patch fixes
it by just accessing the bytes which we operate on.

Before patch:

syz-executor-5567  [007] .... 51370.561696: kvm_mmio: mmio write len 3 gpa 0x10 val 0x1ffff10077c1010f

After patch:

syz-executor-13416 [002] .... 51302.299573: kvm_mmio: mmio write len 3 gpa 0x10 val 0xc1010f

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>
Tested-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-17 09:38:49 +01:00
..
acpi ACPICA: Linuxize: Restore and fix Intel compiler build 2017-02-26 11:10:52 +01:00
asm-generic kaiser: cleanups while trying for gold link 2018-01-05 15:46:33 +01:00
clocksource
crypto crypto: mcryptd - protect the per-CPU queue with a lock 2017-12-29 17:42:58 +01:00
drm drm: Don't race connector registration 2017-06-17 06:41:53 +02:00
dt-bindings ARM: dts: Fix omap3 off mode pull defines 2017-11-21 09:23:22 +01:00
keys
kvm ARM: KVM: Support vgic-v3 2016-09-22 13:22:21 +02:00
linux kernel: make groups_sort calling a responsibility group_info allocators 2018-01-10 09:29:52 +01:00
math-emu
media Linux 4.8 2016-10-05 16:43:53 -03:00
memory
misc
net mac80211: Add RX flag to indicate ICV stripped 2018-01-17 09:38:49 +01:00
pcmcia
ras
rdma IB/core: Fix calculation of maximum RoCE MTU 2017-12-20 10:07:32 +01:00
rxrpc rxrpc: Add tracepoint for ACK proposal 2016-09-23 15:49:19 +01:00
scsi scsi: libsas: align sata_device's rps_resp on a cacheline 2017-12-14 09:28:11 +01:00
soc ARM: at91: define LPDDR types 2017-03-12 06:41:41 +01:00
sound ALSA: seq: Avoid invalid lockdep class warning 2017-11-15 15:53:18 +01:00
target target: fix ALUA transition timeout handling 2017-12-20 10:07:26 +01:00
trace KVM: Fix stack-out-of-bounds read in write_mmio 2018-01-17 09:38:49 +01:00
uapi usb: add helper to extract bits 12:11 of wMaxPacketSize 2017-12-20 10:07:16 +01:00
video fbdev changes for 4.9 2016-10-12 11:01:37 -07:00
xen swiotlb-xen: implement xen_swiotlb_dma_mmap callback 2017-10-05 09:44:05 +02:00
Kbuild