bugdmidecode - Bugs: bug #46176, Unexpected end of file error

 
 

bug #46176: Unexpected end of file error

Submitted by:  Gokcen <gokcen>
Submitted on:  Sun 11 Oct 2015 11:51:48 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned to: Jean Delvare <khali>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Fri 15 Jan 2016 12:41:31 PM UTC, comment #8:

Seems working now, thanks a lot!

Gokcen <gokcen>
Mon 02 Nov 2015 08:52:17 AM UTC, comment #7:

Fixed:

http://git.savannah.gnu.org/cgit/dmidecode.git/commit/?id=de9a74e1c60210bee229fcf55b1678a99d1b44dd

http://git.savannah.gnu.org/cgit/dmidecode.git/commit/?id=364055211b1956539c6a6268e111e244e1292c8c

Jean Delvare <khali>
Project AdministratorIn charge of this item.
Sat 17 Oct 2015 05:13:27 PM UTC, comment #6:

I've attached a fix, please give it a try if possible.

Jean Delvare <khali>
Project AdministratorIn charge of this item.
Wed 14 Oct 2015 06:05:35 PM UTC, comment #5:

Thanks a lot for your thorough investigation. I will check if any further updates from Apple fix the DMI table.

Gokcen <gokcen>
Wed 14 Oct 2015 01:21:52 PM UTC, comment #4:

Thanks for attaching all the files. I have looked at the binary dump and it turns out that DMI records 0x0029, 0x002A and 0x002B in your DMI table are corrupted. They have too many zeroes at the end, that does not comply with the SMBIOS specification. After fixing them manually, dmidecode can decode the whole table. However the right way to address the problem is to fix the table itself in your system's firmware. You should look for an update from the vendor. If you can't find any, you should report the problem and ask them for one.

When reading the table directly through /dev/mem, dmidecode will decode as much as possible, and will give up at the first corruption. However, when reading from sysfs, the kernel has already attempted to parse the table and will only export the part that was successfully decoded. While questionable, this approach ensures that no unrelated data is leaked to user-space after the DMI table if the length mentioned in the entry point was too large.

I believe that the proper fix (besides getting your system's firmware fixed, of course) would be to not let dmidecode assume that the sysfs DMI file size will always match the length announced in the entry point. Instead, it should always read the file, and simply complain if the actual size doesn't match the expected size. That way, dmidecode would behave the same with and without --no-sysfs, which I believe is desirable.

I'll prepare a patch.

Jean Delvare <khali>
Project AdministratorIn charge of this item.
Tue 13 Oct 2015 04:32:29 PM UTC, comment #3:

dmidecode --no-sysfs seems to be working, although it gives "Invalid entry length(0) DMI table is broken" in the end.

I am using kernel 4.2.2 by the way.

Gokcen <gokcen>
Tue 13 Oct 2015 07:25:09 AM UTC, comment #2:

Thanks for the report.

The actual DMI table length is inconsistent with the table length encoded in the SMBIOS entry point. The entry point says the table should be 2597 byte long, but the DMI file in sysfs is only 2379 byte long. Either the structure count or the table length is wrong in the entry point, and that causes the kernel to truncate the DMI file in sysfs.

Which exact kernel version are you running?

Please try "dmidecode --no-sysfs" and report if it makes a difference.

Please attach the contents of file /sys/firmware/dmi/tables/smbios_entry_point as well as the file generated by "dmidecode --dump-bin".

Jean Delvare <khali>
Project AdministratorIn charge of this item.
Sun 11 Oct 2015 11:53:58 AM UTC, comment #1:

/sys/firmware/dmi/tables/DMI file is attached. I am using a macbook pro, and OS X 10.11 is installed alongside Linux.

Gokcen <gokcen>
Sun 11 Oct 2015 11:51:48 AM UTC, original submission:

dmidecode command gives the following error:

$ sudo dmidecode
# dmidecode 3.0
Getting SMBIOS data from sysfs.
SMBIOS 2.4 present.
45 structures occupying 2597 bytes.
Table at 0x7AD14000.

/sys/firmware/dmi/tables/DMI: Unexpected end of file
Table is unreachable, sorry.

Gokcen <gokcen>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #35221:  dmidecode-46176.patch added by khali (4KiB - text/x-patch - Candidate fix)
file #35181:  dmidecode-dump-bin added by gokcen (31B - application/octet-stream - dmidecode --dump-bin, dmidecode --no-sysfs, dmidecode --nosysfs --dump-bin and smbios_entry_point files attached)
file #35182:  dmi-nosysfs.dump added by gokcen (13KiB - application/octet-stream - dmidecode --dump-bin, dmidecode --no-sysfs, dmidecode --nosysfs --dump-bin and smbios_entry_point files attached)
file #35183:  dmidecode-nosysfs-dumpbin added by gokcen (3KiB - application/octet-stream - dmidecode --dump-bin, dmidecode --no-sysfs, dmidecode --nosysfs --dump-bin and smbios_entry_point files attached)
file #35184:  smbios_entry_point added by gokcen (31B - application/octet-stream - dmidecode --dump-bin, dmidecode --no-sysfs, dmidecode --nosysfs --dump-bin and smbios_entry_point files attached)
file #35145:  DMI added by gokcen (2KiB - application/octet-stream - DMI file)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by khali (Posted a comment)
  • -unavailable- added by gokcen (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 11 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 02 Nov 2015 08:53:00 AM UTCkhaliOpen/ClosedOpen=>Closed
    Mon 02 Nov 2015 08:52:17 AM UTCkhaliStatusConfirmed=>Fixed
    Sat 17 Oct 2015 05:12:18 PM UTCkhaliAttached File-=>Added dmidecode-46176.patch, #35221
    Wed 14 Oct 2015 01:21:52 PM UTCkhaliStatusNeed Info=>Confirmed
    Tue 13 Oct 2015 04:30:08 PM UTCgokcenAttached File-=>Added dmidecode-dump-bin, #35181
      Attached File-=>Added dmi-nosysfs.dump, #35182
      Attached File-=>Added dmidecode-nosysfs-dumpbin, #35183
      Attached File-=>Added smbios_entry_point, #35184
    Tue 13 Oct 2015 07:25:09 AM UTCkhaliStatusNone=>Need Info
      Assigned toNone=>khali
    Sun 11 Oct 2015 11:53:06 AM UTCgokcenAttached File-=>Added DMI, #35145

    Back to the top


    Powered by Savane 3.1-cleanup1