Project

General

Profile

Actions

Bug #14234

closed

smbios chassis elements need work

Added by Robert Mustacchi 6 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Category:
lib - userland libraries
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

While looking at things related to #14233 I discovered the current way that we get the chassis elements is somewhat circumspect. It notably doesn't check for valid lengths. In addition, its use of going through smbios_info_contains actually discards information and the resulting code would have left anyone else going through it and using it in a likely trap. This covers adding a dedicated routine for getting this that gives full access to the data and checks the length. In addition, this combined wit #14233 has motivated adding a bunch of test cases for the chassis type in smbios.

Actions #1

Updated by Electric Monk 6 months ago

  • Gerrit CR set to 1796
Actions #2

Updated by Robert Mustacchi 6 months ago

I tested this through general test suite additions (see #14231) and manual dumping of those tables that were used in the tests and those from a few users. This now displays the elements in the table if present, e.g.:

rm@beowulf:~/t$ smbios 'chassis - 2.4 version with comps.smbios'
ID    SIZE TYPE
1     59   SMB_TYPE_CHASSIS (type 3) (system enclosure or chassis)

  Manufacturer: Shrina
  Version: 7R
  Serial Number: What's my number?
  Asset Tag: lost

  OEM Data: 0x36105997
  SKU Number: <unknown>
  Lock Present: N
  Chassis Type: 0x10 (lunchbox)
  Boot-Up State: 0x3 (safe)
  Power Supply State: 0x6 (non-recoverable)
  Thermal State: 0x4 (warning)
  Chassis Height: 7u
  Power Cords: 6
  Element Records: 2

  Contained SMBIOS structure Type: 27 (SMB_TYPE_COOLDEV)
    Minimum number: 1
    Maximum number: 42
  Contained SMBIOS Base Board Type: 0x7 (i/o module)
    Minimum number: 5
    Maximum number: 123
Actions #3

Updated by Electric Monk 6 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit d53cdfab6d4896af92b7a3df87a26060caf179ae

commit  d53cdfab6d4896af92b7a3df87a26060caf179ae
Author: Robert Mustacchi <rm@fingolfin.org>
Date:   2021-11-19T01:47:24.000Z

    14231 want support for SMBIOS 3.5
    14232 several smbios_info_* routines don't check for bad ids
    14233 smbios_info_chassis calculates sku number incorrectly
    14234 smbios chassis elements need work
    Reviewed by: Yuri Pankov <ypankov@tintri.com>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Rich Lowe <richlowe@richlowe.net>

Actions

Also available in: Atom PDF