Re: [PATCH 1/3] nfit: in acpi_nfit_init, break on a 0-length table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2015-10-09 at 10:27 -0700, Dan Williams wrote:
> On Fri, Oct 9, 2015 at 10:23 AM, Jeff Moyer <jmoyer@xxxxxxxxxx>
> wrote:
> > Vishal Verma <vishal.l.verma@xxxxxxxxx> writes:
> > 
> > > If acpi_nfit_init is called (such as from nfit_test), with an
> > > nfit table
> > > that has more memory allocated than it needs (and a similarly
> > > large
> > > 'size' field, add_tables would happily keep adding null SPA Range
> > > tables
> > > filling up all available memory.
> > > 
> > > Make it friendlier by breaking out if a 0-length header is found
> > > in any
> > > of the tables.
> > 
> > Shouldn't that at least spew a warning?  Or does the spec allow for
> > zero-length tables?
> > 
> 
> The spec allows for zero length tables but the firmware
> implementation
> should be self consistent and not report a total NFIT size that is
> greater than the sum of the size of the sub-structures.  A warning /
> nudge to firmware developers to fix their stuff seems appropriate.

Agreed, I'll add a warning. The caveat is, the following (3/3) patch to
nfit test will trigger the warning for the first, non-hotplug pass, as
I just calculate the size and allocate the buffer once, and the first
pass will have the regular nfit, and the second pass will have new
hotplug entries.. Is that OK or should I look at reworking that?��.n��������+%������w��{.n�����{�����ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f




[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux