All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Verma, Vishal L" <vishal.l.verma@intel.com>
To: "Williams, Dan J" <dan.j.williams@intel.com>,
	"linda.knippers@hpe.com" <linda.knippers@hpe.com>
Cc: "linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>,
	"toshi.kani@hpe.com" <toshi.kani@hpe.com>,
	"jmoyer@redhat.com" <jmoyer@redhat.com>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"elliott@hpe.com" <elliott@hpe.com>,
	"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>
Subject: Re: [PATCH 1/3] nfit: Account for table size length variation
Date: Tue, 24 Nov 2015 17:47:00 +0000	[thread overview]
Message-ID: <1448387220.27481.12.camel@intel.com> (raw)
In-Reply-To: <56548F20.7090407@hpe.com>

On Tue, 2015-11-24 at 11:24 -0500, Linda Knippers wrote:
> 
> Actually, the spec is pretty clear in this case.  If you look at the
> length definition for that table (5-133) it says:
> 
> 	Length in bytes for entire structure.
> 	The length of this structure is either 32 bytes or 80 bytes. The
> 	length of the structure can be 32 bytes only if the Number of
> 	Block Control Windows field has a value of 0.
> 
> The structure is 80 bytes but it is legal to have a 32-byte table.
> We hit a similar problem with the original NFIT code.  We could
> explicitly check for a size of 32 but we didn't before.

Thanks, I missed that. No objections from me any more :)

> 
> > If we make add_tables process only header.length and accept the
> > shortened table, there is nothing to tell future code that the
> > structure
> > that piece of memory is casted to is a truncated one.
> > 
> > Thoughts?
> 
> If we want to be more paranoid about buggy FW when we're comparing old
> and new tables, we could compare based on the length of the old and
> new
> tables since we have both pieces of information.  That would let you
> catch
> the case where a table size changes during a hotplug event or whenever
> the
> _FIT is processed.  Since you were comparing based on structure size
> instead
> of header length, I didn't change that.

Agreed this can be incremental work.

> 
> -- ljk
> > 
> > 	-Vishal
> > 
> 

  parent reply	other threads:[~2015-11-24 17:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-21  0:05 [PATCH 0/3] fix NVDIMM hotplug changes Linda Knippers
2015-11-21  0:05 ` [PATCH 1/3] nfit: Account for table size length variation Linda Knippers
2015-11-23 23:21   ` Verma, Vishal L
2015-11-24 16:24     ` Linda Knippers
2015-11-24 16:31       ` Dan Williams
2015-11-24 17:47       ` Verma, Vishal L [this message]
2015-11-21  0:05 ` [PATCH 2/3] nfit: Fix the check for a successful NFIT merge Linda Knippers
2015-11-21  0:05 ` [PATCH 3/3] nfit: Adjust for different _FIT and NFIT headers Linda Knippers
2015-11-23 23:26   ` Verma, Vishal L
2015-11-24 16:31     ` Linda Knippers
2015-11-24 17:52       ` Verma, Vishal L

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=1448387220.27481.12.camel@intel.com \
    --to=vishal.l.verma@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=elliott@hpe.com \
    --cc=jmoyer@redhat.com \
    --cc=linda.knippers@hpe.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=toshi.kani@hpe.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.