public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: Matt Fleming <matt@codeblueprint.co.uk>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Matt Fleming <matt.fleming@intel.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Subject: Re: [PATCH] firmware: dmi_scan: Prevent dmi_num integer overflow
Date: Thu, 26 Mar 2015 14:15:05 +0100	[thread overview]
Message-ID: <1427375705.4261.2.camel@chaos.site> (raw)
In-Reply-To: <20150326130651.GC6525@codeblueprint.co.uk>

Hi Matt,

Le Thursday 26 March 2015 à 13:06 +0000, Matt Fleming a écrit :
> On Fri, 20 Mar, at 09:59:47AM, Jean Delvare wrote:
> > dmi_num is a u16, dmi_len is a u32, so this construct:
> > 
> > 	dmi_num = dmi_len / 4;
> > 
> > would result in an integer overflow for a DMI table larger than
> > 256 kB. I've never see such a large table so far, but SMBIOS 3.0
> > makes it possible so maybe we'll see such tables in the future.
> > 
> > So instead of faking a structure count when the entry point does
> > not provide it, adjust the loop condition in dmi_table() to properly
> > deal with the case where dmi_num is not set.
> > 
> > Signed-off-by: Jean Delvare <jdelvare@suse.de>
> > Cc: Matt Fleming <matt.fleming@intel.com>
> > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> > Cc: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
> > ---
> >  drivers/firmware/dmi_scan.c |   22 +++++++---------------
> >  1 file changed, 7 insertions(+), 15 deletions(-)
> 
> Jean, are you taking this through your tree?

I don't actually have a tree, so feel free to pick it.

Thanks,
-- 
Jean Delvare
SUSE L3 Support


  reply	other threads:[~2015-03-26 13:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-20  8:59 [PATCH] firmware: dmi_scan: Prevent dmi_num integer overflow Jean Delvare
2015-03-20  9:21 ` Ard Biesheuvel
2015-03-26 13:06 ` Matt Fleming
2015-03-26 13:15   ` Jean Delvare [this message]
2015-03-26 14:47     ` Matt Fleming
2015-03-26 15:21       ` Jean Delvare
2015-03-27 12:12         ` Matt Fleming
2015-03-27 13:22           ` Jean Delvare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427375705.4261.2.camel@chaos.site \
    --to=jdelvare@suse.de \
    --cc=ard.biesheuvel@linaro.org \
    --cc=ivan.khoronzhuk@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt.fleming@intel.com \
    --cc=matt@codeblueprint.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox