lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20110720114933.GD4856@suse.de>
Date:	Wed, 20 Jul 2011 13:49:33 +0200
From:	Marcus Meissner <meissner@...e.de>
To:	Jan Kiszka <jan.kiszka@...mens.com>
Cc:	quintela@...hat.com, Marcus Meissner <meissner@...ell.com>,
	avi@...hat.com, mtosatti@...hat.com, tglx@...utronix.de,
	mingo@...hat.com, hpa@...or.com, x86@...nel.org,
	kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] kvm: Initialize all struct members to avoid stack information leak

On Tue, Jul 19, 2011 at 07:38:27PM +0200, Jan Kiszka wrote:
> On 2011-07-19 16:12, Juan Quintela wrote:
> > Marcus Meissner <meissner@...ell.com> 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@...ec.com>
> >> Signed-off-by: Marcus Meissner <meissner@...e.de>
> >> ---
> >>  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?
> 
> Good question. Information leaks were once addressed by 97e69aa62f, and
> kvm_vcpu_events was not changed since then.

I was looking at old code, did not cross check if it is fixed in mainline.

Sorry for the noise.

Ciao, Marcus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ