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: <20100512231906.GB3588@kroah.com>
Date:	Wed, 12 May 2010 16:19:06 -0700
From:	Greg KH <greg@...ah.com>
To:	Borislav Petkov <borislav.petkov@....com>
Cc:	Jiri Kosina <jkosina@...e.cz>,
	"Ostrovsky, Boris" <Boris.Ostrovsky@....com>,
	"Herrmann3, Andreas" <Andreas.Herrmann3@....com>,
	Greg KH <gregkh@...e.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"stable@...nel.org" <stable@...nel.org>, Jiri Benc <jbenc@...e.cz>,
	Thomas Renninger <trenn@...e.de>, Ingo Molnar <mingo@...e.hu>,
	"H. Peter Anvin" <hpa@...or.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	"stable-review@...nel.org" <stable-review@...nel.org>,
	Alan Cox <alan@...rguk.ukuu.org.uk>
Subject: Re: [stable] [113/197] x86, cacheinfo: Calculate L3 indices

On Thu, May 06, 2010 at 04:13:58PM +0200, Borislav Petkov wrote:
> From: Jiri Kosina <jkosina@...e.cz>
> Date: Thu, May 06, 2010 at 09:46:21AM -0400
> 
> > Well, we have
> > 
> > 	#ifdef CONFIG_K8_NB
> > 	static inline struct pci_dev *node_to_k8_nb_misc(int node)
> > 	{
> > 		return (node < num_k8_northbridges) ? k8_northbridges[node] : NULL;
> > 	}
> > 	#else
> > 	static inline struct pci_dev *node_to_k8_nb_misc(int node)
> > 	{
> > 		return NULL;
> > 	}
> > 	#endif
> > 
> > So it legitimately returns NULL in two cases:
> > 
> > 	1) if someone passes too large node
> > 	2) if CONFIG_K8_NB is unset
> > 
> > 1) Either we assume that node will always be in the range (i.e. 
> > amd_get_nb_id() will never go crazy return anything bogus), and then we 
> > could just drop the test completely. Or we want to check for such the 
> > possibility, and then node_to_k8_nb_misc() is going to return NULL in such 
> > cases, and so we want to check for it.
> 
> No, we want to check it since K8_NB has many users - not only L3.
> 
> > 2) is now moot, as all three in-tree callers are now under proper ifdefs 
> > (CONFIG_CPU_SUP_AMD, which depends on CONFIG_K8_NB after your patch has 
> > been applied). So I believe we could remove it, right?
> 
> I don't think I understand "remove it" here. Which "it" you're referring to?
> 
> > Either way, current state seems inconsistent. So either we should add the 
> > return value check to amd_calc_l3_indices() as well, or remove all the 
> > NULL magic altogether, i.e. the (untested) patch below.
> > 
> > What do you think?
> 
> Take a look at 
> 
> http://git.kernel.org/?p=linux/kernel/git/x86/linux-2.6-tip.git;a=commitdiff;h=f2b20e41407fccfcfacf927ff91ec888832a37af
> 
> This does
> 
> +       if (num_k8_northbridges == 0)
> +               return;
> 
> in amd_check_l3_disable().
> 
> So if K8_NB has failed initializing for some reason, we never go near
> the pci devs and the node_to_k8_nb_misc() calls since we effectively
> disable the L3 functionality.
> 
> Thus the NULL pointer checks you remove in the patch below are
> superfluous, I agree, and I have already removed those in my tree along
> with the other improvements/fixes I'm working on right now.

So, was there ever a patch applied that fixed the bug that Jiri found in
the stable kernels with this original patch that I could apply?

thanks,

greg k-h
--
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