public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jean Delvare <jdelvare@suse.de>
To: Ben Hutchings <ben@decadent.org.uk>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: Suspect loop in dmi_scan_machine()
Date: Tue, 09 Jul 2013 10:35:47 +0200	[thread overview]
Message-ID: <1373358947.4391.3.camel@chaos.site> (raw)
In-Reply-To: <20130708163357.GA4752@decadent.org.uk>

Hi Ben,

Le Monday 08 July 2013 à 17:33 +0100, Ben Hutchings a écrit :
> On Mon, Jul 08, 2013 at 05:49:14PM +0200, Jean Delvare wrote:
> > I am looking at this commit of yours:
> > 
> > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/firmware/dmi_scan.c?id=79bae42d51a5d498500c890c19ef76df41d2bf59
> > 
> > and am a little worried about the for loop in dmi_scan_machine()
> > (non-EFI case):
> [...]
> 
> I don't see any of the bugs you describe.  Let me explain what
> I probably should have put in a comment:
> 
> We want to find a DMI header at [0xf0000, 0xffff0] and possibly an
> SMBIOS header 16 bytes before that.  buf contains a copy of the 32
> bytes centred at p.  On the first iteration p - 16 is out of range, so
> the first 16 bytes of the buffer are filled with zeroes.
> 
> Does that address your concerns?  If not then please explain precisely
> how this loop can go wrong.

Wow. I'm not sure what I was up to yesterday evening but I definitely
should have waited a bit before posting. I read your code again this
morning and it is completely correct, and the concerns I raised
yesterday were plain crap. I suppose your code was too smart for my
tired brain...

Sorry for the noise,
-- 
Jean Delvare
Suse L3


      reply	other threads:[~2013-07-09  8:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-08 15:49 Suspect loop in dmi_scan_machine() Jean Delvare
2013-07-08 16:33 ` Ben Hutchings
2013-07-09  8:35   ` Jean Delvare [this message]

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=1373358947.4391.3.camel@chaos.site \
    --to=jdelvare@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=ben@decadent.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    /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