From: Alexander Graf <agraf@suse.de>
To: Vasiliy Kulikov <segooon@gmail.com>
Cc: kvm@vger.kernel.org, Marcelo Tosatti <mtosatti@redhat.com>,
kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
kvm-ppc@vger.kernel.org, Paul Mackerras <paulus@samba.org>,
Avi Kivity <avi@redhat.com>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2] powerpc: kvm: powerpc: fix information leak to userland
Date: Sat, 30 Oct 2010 12:16:57 -0700 [thread overview]
Message-ID: <1480CDBF-0A4A-49EC-AF4C-CED1D63BB911@suse.de> (raw)
In-Reply-To: <1288464922-8812-1-git-send-email-segooon@gmail.com>
On 30.10.2010, at 11:55, Vasiliy Kulikov wrote:
> Structure kvm_ppc_pvinfo is copied to userland with "flags" and "pad"
> fields unitialized. It leads to leaking of contents of kernel stack
> memory. We have to initialize them to zero.
>=20
> In patch v1 Jan Kiszka suggested to fill reserved fields with zeros
> instead of memset'ting the whole struct. It makes sense as these
> fields are explicitly marked as padding. No more fields need zeroing.
>=20
> Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
> ---
> arch/powerpc/kvm/powerpc.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>=20
> diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
> index 2f87a16..5962336 100644
> --- a/arch/powerpc/kvm/powerpc.c
> +++ b/arch/powerpc/kvm/powerpc.c
> @@ -604,6 +604,8 @@ static int kvm_vm_ioctl_get_pvinfo(struct =
kvm_ppc_pvinfo *pvinfo)
> pvinfo->hcall[1] =3D inst_ori | (KVM_SC_MAGIC_R0 & =
inst_imm_mask);
> pvinfo->hcall[2] =3D inst_sc;
> pvinfo->hcall[3] =3D inst_nop;
> + pvinfo->flags =3D 0;
> + memset(&pvinfo->pad, 0, sizeof(pvinfo->pad));
This should only be memset(pvinfo->pad), no? It's an array after all =
which automatically translates to a pointer when referenced.
Alex
prev parent reply other threads:[~2010-10-30 19:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-30 18:55 [PATCH v2] powerpc: kvm: powerpc: fix information leak to userland Vasiliy Kulikov
2010-10-30 19:16 ` Alexander Graf [this message]
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=1480CDBF-0A4A-49EC-AF4C-CED1D63BB911@suse.de \
--to=agraf@suse.de \
--cc=avi@redhat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mtosatti@redhat.com \
--cc=paulus@samba.org \
--cc=segooon@gmail.com \
/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