Skip to content

Commit

Permalink
bhyve smbios type 3 structure is incorrect
Browse files Browse the repository at this point in the history
If you look at the SMBIOS specification, we'll find something is
missing. In particular at offset 0Dh is supposed to be the OEM-defined
field. This should go between security and height. It is not legal to
actually skip this and will lead to other folks not properly
interpreting later parts of the table.

https://www.illumos.org/issues/14312

Reviewed by:	jhb
Submitted by:	Robert Mustacchi <[email protected]>
Obtained from:	ilumos
Differential Revision: https://reviews.freebsd.org/D33682

(cherry picked from 04f55b5)
  • Loading branch information
Toomas Soome authored and Toomas Soome committed Jan 6, 2022
1 parent 6000a41 commit 1d15c6b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions usr.sbin/bhyve/smbiostbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ struct smbios_table_type3 {
uint8_t psstate; /* power supply state */
uint8_t tstate; /* thermal state */
uint8_t security; /* security status */
uint32_t oemdata; /* OEM-specific data */
uint8_t uheight; /* height in 'u's */
uint8_t cords; /* number of power cords */
uint8_t elems; /* number of element records */
Expand Down Expand Up @@ -417,6 +418,7 @@ struct smbios_table_type3 smbios_type3_template = {
SMBIOS_CHST_SAFE,
SMBIOS_CHST_SAFE,
SMBIOS_CHSC_NONE,
0, /* OEM specific data, we have none */
0, /* height in 'u's (0=enclosure height unspecified) */
0, /* number of power cords (0=number unspecified) */
0, /* number of contained element records */
Expand Down

0 comments on commit 1d15c6b

Please sign in to comment.