From: Jan Kiszka <jan.kiszka@siemens.com>
To: quintela@redhat.com
Cc: Marcus Meissner <meissner@novell.com>,
avi@redhat.com, mtosatti@redhat.com, tglx@linutronix.de,
mingo@redhat.com, hpa@zytor.com, x86@kernel.org,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
Marcus Meissner <meissner@suse.de>
Subject: Re: [PATCH] kvm: Initialize all struct members to avoid stack information leak
Date: Tue, 19 Jul 2011 19:38:27 +0200 [thread overview]
Message-ID: <4E25C113.9080500@siemens.com> (raw)
In-Reply-To: <m3livutl3p.fsf@neno.neno>
On 2011-07-19 16:12, Juan Quintela wrote:
> Marcus Meissner <meissner@novell.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@atsec.com>
>> Signed-off-by: Marcus Meissner <meissner@suse.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.
Jan
--
Siemens AG, Corporate Technology, CT T DE IT 1
Corporate Competence Center Embedded Linux
next prev parent reply other threads:[~2011-07-19 17:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-19 13:17 [PATCH] kvm: Initialize all struct members to avoid stack information leak Marcus Meissner
2011-07-19 14:12 ` Juan Quintela
2011-07-19 17:38 ` Jan Kiszka [this message]
2011-07-20 11:49 ` Marcus Meissner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E25C113.9080500@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=avi@redhat.com \
--cc=hpa@zytor.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=meissner@novell.com \
--cc=meissner@suse.de \
--cc=mingo@redhat.com \
--cc=mtosatti@redhat.com \
--cc=quintela@redhat.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox