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] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1005052328000.9849@pobox.suse.cz>
Date:	Wed, 5 May 2010 23:33:45 +0200 (CEST)
From:	Jiri Kosina <jkosina@...e.cz>
To:	Borislav Petkov <borislav.petkov@....com>
Cc:	Greg KH <gregkh@...e.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"stable@...nel.org" <stable@...nel.org>,
	"stable-review@...nel.org" <stable-review@...nel.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	"H. Peter Anvin" <hpa@...or.com>, Ingo Molnar <mingo@...e.hu>,
	Thomas Renninger <trenn@...e.de>, Jiri Benc <jbenc@...e.cz>,
	"Herrmann3, Andreas" <Andreas.Herrmann3@....com>,
	"Ostrovsky, Boris" <Boris.Ostrovsky@....com>
Subject: Re: [113/197] x86, cacheinfo: Calculate L3 indices

On Wed, 5 May 2010, Borislav Petkov wrote:

> > From: Jiri Kosina <jkosina@...e.cz>
> > Subject: [PATCH] x86, cacheinfo: fix oops in amd_calc_l3_indices()
> > 
> > Commit 048a8774ca4348 ("x86, cacheinfo: Calculate L3 indices") introduced
> > amd_calc_l3_indices(), but this function doesn't properly handle case
> > when node_to_k8_nb_misc() returns NULL, causing immediate oops due to
> > NULL pointer dereference in pci_read_config_dword().
> > 
> > Make amd_calc_l3_indices() return -1 in such cases. This is correct
> > lower bound, as it will make store_cache_disable() return EINVAL in
> > all such cases.
> > 
> > Cc: stable@...nel.org
> > Signed-off-by: Jiri Kosina <jkosina@...e.cz>
> > ---
> >  arch/x86/kernel/cpu/intel_cacheinfo.c |    3 +++
> >  1 files changed, 3 insertions(+), 0 deletions(-)
> > 
> > diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
> > index b3eeb66..b9f8dca 100644
> > --- a/arch/x86/kernel/cpu/intel_cacheinfo.c
> > +++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
> > @@ -314,6 +314,9 @@ static unsigned int __cpuinit amd_calc_l3_indices(void)
> >  	unsigned int sc0, sc1, sc2, sc3;
> >  	u32 val = 0;
> >  
> > +	if (!dev)
> > +		return -1;
> > +
> 
> This won't fly since the function returns an unsigned value and the L3
> code would still be entered, which is what you don't want actually when
> k8_northbridges initialization has somehow failed.

Yeah, you are right, returning -1 is bogus as well.

The point is though, that we really should be checking for return value of 
node_to_k8_nb_misc() as it can legitimately return NULL, can't it? (and 
other places, such as show_cache_disable() and store_cache_disable(), are 
checking for this being NULL properly).

> Rather, we have a fix already which should take care of your issue too,
> see http://git.kernel.org/tip/f2b20e41407fccfcfacf927ff91ec888832a37af
> 
> I was waiting for it to hit mainline before I backport it to stable and
> it would be helpful if you could verify that it works for you along with
> 0e152cd7c16832bd5cadee0c2e41d9959bc9b6f9 you sent earlier.

Will let you know.

Thanks,

-- 
Jiri Kosina
SUSE Labs, Novell Inc.
--
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