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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 25 May 2009 10:47:06 +0530
From:	Jaswinder Singh Rajput <jaswinder@...nel.org>
To:	Avi Kivity <avi@...hat.com>
Cc:	Ingo Molnar <mingo@...e.hu>, x86 maintainers <x86@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -tip] x86: kvm/paging_tmpl.h intialize the variable
 before using it

Hello Avi,

On Sun, 2009-05-24 at 15:21 +0300, Avi Kivity wrote:
> Jaswinder Singh Rajput wrote:
> > May be in some cases paging64_fetch() and paging32_fetch() will return sptep
> > without initialization.
> >
> > Also fixes compilation warning:
> >   CC      arch/x86/kernel/io_delay.o
> >  arch/x86/kvm/paging_tmpl.h: In function ‘paging64_fetch’:
> >  arch/x86/kvm/paging_tmpl.h:279: warning: ‘sptep’ may be used uninitialized in this function
> >  arch/x86/kvm/paging_tmpl.h: In function ‘paging32_fetch’:
> >  arch/x86/kvm/paging_tmpl.h:279: warning: ‘sptep’ may be used uninitialized in this function
> >
> > Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@...il.com>
> > ---
> >  arch/x86/kvm/paging_tmpl.h |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/arch/x86/kvm/paging_tmpl.h b/arch/x86/kvm/paging_tmpl.h
> > index 6bd7020..99cb10d 100644
> > --- a/arch/x86/kvm/paging_tmpl.h
> > +++ b/arch/x86/kvm/paging_tmpl.h
> > @@ -276,7 +276,7 @@ static u64 *FNAME(fetch)(struct kvm_vcpu *vcpu, gva_t addr,
> >  {
> >  	unsigned access = gw->pt_access;
> >  	struct kvm_mmu_page *shadow_page;
> > -	u64 spte, *sptep;
> > +	u64 spte, *sptep = NULL;
> >  	int direct;
> >  	gfn_t table_gfn;
> >  	int r;
> >   
> 
> It's a false alarm.  Isn't there a macro to shut up the warning?
> 

In arch/x86/kvm/paging_tmpl.h sptep is initialize only in :

for_each_shadow_entry(vcpu, addr, iterator) {

If we skip this, then we end up with wild sptep and returning it.

Do you still think it is a false alarm ?

--
JSR


--
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