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: <20131014032113.GB12189@gchen.bj.intel.com>
Date:	Sun, 13 Oct 2013 23:21:13 -0400
From:	Chen Gong <gong.chen@...ux.intel.com>
To:	Borislav Petkov <bp@...en8.de>
Cc:	tony.luck@...el.com, linux-kernel@...r.kernel.org,
	linux-acpi@...r.kernel.org
Subject: Re: [PATCH 4/8] DMI: Parse memory device (type 17) in SMBIOS

On Fri, Oct 11, 2013 at 05:40:48PM +0200, Borislav Petkov wrote:
> Date: Fri, 11 Oct 2013 17:40:48 +0200
> From: Borislav Petkov <bp@...en8.de>
> To: "Chen, Gong" <gong.chen@...ux.intel.com>
> Cc: tony.luck@...el.com, linux-kernel@...r.kernel.org,
>  linux-acpi@...r.kernel.org
> Subject: Re: [PATCH 4/8] DMI: Parse memory device (type 17) in SMBIOS
> User-Agent: Mutt/1.5.21 (2010-09-15)
> 
> On Fri, Oct 11, 2013 at 02:32:42AM -0400, Chen, Gong wrote:
> > This patch adds a new interface to decode memory device (type 17)
> > to help error reporting on DIMMs.
> > 
> > Original-author: Tony Luck <tony.luck@...el.com>
> > Signed-off-by: Chen, Gong <gong.chen@...ux.intel.com>
> 
> Reviewed-by: Borislav Petkov <bp@...e.de>
> 
> Just a question below:
> 
> > ---
> >  arch/ia64/kernel/setup.c    |  1 +
> >  arch/x86/kernel/setup.c     |  1 +
> >  drivers/firmware/dmi_scan.c | 60 +++++++++++++++++++++++++++++++++++++++++++++
> >  include/linux/dmi.h         |  5 ++++
> >  4 files changed, 67 insertions(+)
> > 
> 
> [ ... ]
> 
> > diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
> > index fa0affb..ca3619d 100644
> > --- a/drivers/firmware/dmi_scan.c
> > +++ b/drivers/firmware/dmi_scan.c
> > @@ -25,6 +25,13 @@ static int dmi_initialized;
> >  /* DMI system identification string used during boot */
> >  static char dmi_ids_string[128] __initdata;
> >  
> > +static struct dmi_memdev_info {
> > +	const char *device;
> > +	const char *bank;
> > +	u16 handle;
> > +} *dmi_memdev;
> > +static int dmi_memdev_nr;
> > +
> >  static const char * __init dmi_string_nosave(const struct dmi_header *dm, u8 s)
> >  {
> >  	const u8 *bp = ((u8 *) dm) + dm->length;
> > @@ -322,6 +329,42 @@ static void __init dmi_save_extended_devices(const struct dmi_header *dm)
> >  	dmi_save_one_device(*d & 0x7f, dmi_string_nosave(dm, *(d - 1)));
> >  }
> >  
> > +static void __init count_mem_devices(const struct dmi_header *dm, void *v)
> > +{
> > +	if (dm->type != DMI_ENTRY_MEM_DEVICE)
> > +		return;
> > +	dmi_memdev_nr++;
> > +}
> > +
> > +static void __init save_mem_devices(const struct dmi_header *dm, void *v)
> > +{
> > +	const char *d = (const char *)dm;
> > +	static int nr;
> > +
> > +	if (dm->type != DMI_ENTRY_MEM_DEVICE)
> > +		return;
> > +	if (nr >= dmi_memdev_nr) {
> > +		pr_warn_once("Too many DIMM entries in SMBIOS table\n");
> > +		return;
> 
> Is this and count_mem_devices() some sort of precaution against insane
> DMI tables?
> 

Yes, but we highly expect BIOS manufactors to make is valid and complete.
> -- 
> Regards/Gruss,
>     Boris.
> 
> Sent from a fat crate under my desk. Formatting is fine.
> --

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ