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]
Date:	Wed, 19 Oct 2011 23:09:46 +0200
From:	Borislav Petkov <bp@...64.org>
To:	David Rientjes <rientjes@...gle.com>
Cc:	EDAC devel <linux-edac@...r.kernel.org>,
	Tony Luck <tony.luck@...el.com>, Ingo Molnar <mingo@...e.hu>,
	X86-ML <x86@...nel.org>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 8/9] x86, RAS: Add attributes needed for HW injection

On Wed, Oct 19, 2011 at 05:03:43PM -0400, David Rientjes wrote:
> > +static int inj_extcpu_set(void *data, u64 val)
> > +{
> > +	struct mce *m = (struct mce *)data;
> > +
> > +	if (val >= num_online_cpus()) {
> 
> That wouldn't catch an offline cpuid, you probably want cpu_online(val)?

Good catch, thanks.

So I'm looking at <arch/x86/kernel/cpuid.c> which is how the validity of
a cpu value should be tested properly, IMHO:

static int cpuid_open(struct inode *inode, struct file *file)
{
	...

	if (cpu >= nr_cpu_ids || !cpu_online(cpu))
		return -ENXIO;	/* No such CPU */
	...

Thanks.

-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551
--
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