Re: [PATCH] kvm: Initialize all struct members to avoid stack information leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marcus Meissner <meissner@xxxxxxxxxx> wrote:
> Hi,
>
> Reported to us by Stephan Mueller of atsec.
>
> Several .pad struct members are not set to something, so they
> will leak stack content back to user space.
>
> Ciao, Marcus
>
> Reported-by: Stephan Mueller <smueller@xxxxxxxxx>
> Signed-off-by: Marcus Meissner <meissner@xxxxxxx>
> ---
>  arch/x86/kvm/x86.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 77c9d86..621ffb6 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -3002,6 +3002,7 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
>  	case KVM_GET_VCPU_EVENTS: {
>  		struct kvm_vcpu_events events;
>  
> +		memset(&events, 0, sizeof(events));
>  		kvm_vcpu_ioctl_x86_get_vcpu_events(vcpu, &events);
>  
>  		r = -EFAULT;

Looking at arch/x86/include/asm/kvm.h & arch/x86/kvm/x86.c I can't see
what pad fields are not initialized.  My reading is that everything is
initialized in kvm_vcpu_ioctl_x86_get_vcpu_events().  What field are you
refering to?

Later, Juan.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux