linux-stable/arch/x86/kvm
Ashish Kalra d22d2474e3 KVM: SVM: Use kzalloc for sev ioctl interfaces to prevent kernel data leak
For some sev ioctl interfaces, the length parameter that is passed maybe
less than or equal to SEV_FW_BLOB_MAX_SIZE, but larger than the data
that PSP firmware returns. In this case, kmalloc will allocate memory
that is the size of the input rather than the size of the data.
Since PSP firmware doesn't fully overwrite the allocated buffer, these
sev ioctl interface may return uninitialized kernel slab memory.

Reported-by: Andy Nguyen <theflow@google.com>
Suggested-by: David Rientjes <rientjes@google.com>
Suggested-by: Peter Gonda <pgonda@google.com>
Cc: kvm@vger.kernel.org
Cc: stable@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Fixes: eaf78265a4 ("KVM: SVM: Move SEV code to separate file")
Fixes: 2c07ded064 ("KVM: SVM: add support for SEV attestation command")
Fixes: 4cfdd47d6d ("KVM: SVM: Add KVM_SEV SEND_START command")
Fixes: d3d1af85e2 ("KVM: SVM: Add KVM_SEND_UPDATE_DATA command")
Fixes: eba04b20e4 ("KVM: x86: Account a variety of miscellaneous allocations")
Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
Reviewed-by: Peter Gonda <pgonda@google.com>
Message-Id: <20220516154310.3685678-1-Ashish.Kalra@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-05-25 05:11:51 -04:00
..
mmu KVM: x86/mmu: Speed up slot_rmap_walk_next for sparsely populated rmaps 2022-05-12 09:51:45 -04:00
svm KVM: SVM: Use kzalloc for sev ioctl interfaces to prevent kernel data leak 2022-05-25 05:11:51 -04:00
vmx KVM/riscv changes for 5.19 2022-05-25 05:09:49 -04:00
cpuid.c KVM/arm64 updates for 5.19 2022-05-25 05:09:23 -04:00
cpuid.h kvm: x86: Add support for getting/setting expanded xstate buffer 2022-01-14 13:44:41 -05:00
debugfs.c Merge branch 'kvm-pi-raw-spinlock' into HEAD 2022-01-19 12:14:02 -05:00
emulate.c * Only do MSR filtering for MSRs accessed by rdmsr/wrmsr 2022-04-02 12:09:02 -07:00
fpu.h
hyperv.c KVM: x86: hyper-v: Avoid writing to TSC page without an active vCPU 2022-04-11 13:29:51 -04:00
hyperv.h KVM: x86: hyper-v: Avoid writing to TSC page without an active vCPU 2022-04-11 13:29:51 -04:00
i8254.c KVM: x86: Add wrappers for setting/clearing APICv inhibits 2022-04-02 05:34:44 -04:00
i8254.h
i8259.c KVM: x86/i8259: Remove a dead store of irq in a conditional block 2022-04-02 05:41:19 -04:00
ioapic.c KVM: x86/ioapic: Remove unused "addr" and "length" of ioapic_read_indirect() 2022-02-10 13:47:13 -05:00
ioapic.h x86/kvm: remove unused ack_notifier callbacks 2021-11-18 07:05:57 -05:00
irq.c KVM: x86/xen: handle PV timers oneshot mode 2022-04-02 05:41:16 -04:00
irq.h x86/kvm: remove unused ack_notifier callbacks 2021-11-18 07:05:57 -05:00
irq_comm.c KVM: x86/xen: Make kvm_xen_set_evtchn() reusable from other places 2022-04-02 05:41:14 -04:00
Kconfig KVM: x86/mmu: Remove MMU auditing 2022-02-18 13:46:23 -05:00
kvm_cache_regs.h KVM: X86: Remove kvm_register_clear_available() 2021-12-08 04:25:03 -05:00
kvm_emulate.h * Only do MSR filtering for MSRs accessed by rdmsr/wrmsr 2022-04-02 12:09:02 -07:00
kvm_onhyperv.c KVM: x86: Uninline and export hv_track_root_tdp() 2022-02-10 13:47:19 -05:00
kvm_onhyperv.h KVM: x86: Uninline and export hv_track_root_tdp() 2022-02-10 13:47:19 -05:00
lapic.c KVM: LAPIC: Trace LAPIC timer expiration on every vmentry 2022-05-25 05:07:09 -04:00
lapic.h KVM: LAPIC: Trace LAPIC timer expiration on every vmentry 2022-05-25 05:07:09 -04:00
Makefile KVM: Add Makefile.kvm for common files, use it for x86 2021-12-09 12:56:02 -05:00
mmu.h KVM: VMX: Include MKTME KeyID bits in shadow_zero_check 2022-05-12 09:51:45 -04:00
mtrr.c
pmu.c KVM: x86: Use static calls to reduce kvm_pmu_ops overhead 2022-04-13 13:37:45 -04:00
pmu.h KVM/arm64 updates for 5.19 2022-05-25 05:09:23 -04:00
reverse_cpuid.h
trace.h KVM: SVM: Introduce trace point for the slow-path of avic_kic_target_vcpus 2022-04-29 12:50:00 -04:00
tss.h
x86.c KVM/arm64 updates for 5.19 2022-05-25 05:09:23 -04:00
x86.h ARM: 2022-03-24 11:58:57 -07:00
xen.c KVM: x86/xen: Remove the redundantly included header file lapic.h 2022-04-13 13:37:18 -04:00
xen.h KVM: x86/xen: handle PV timers oneshot mode 2022-04-02 05:41:16 -04:00