git: 1d15c6b3e516 - stable/13 - bhyve smbios type 3 structure is incorrect

From: Toomas Soome <tsoome_at_FreeBSD.org>
Date: Thu, 06 Jan 2022 11:38:19 UTC
The branch stable/13 has been updated by tsoome:

URL: https://cgit.FreeBSD.org/src/commit/?id=1d15c6b3e51637471ace760006e377d59e34a6dc

commit 1d15c6b3e51637471ace760006e377d59e34a6dc
Author:     Toomas Soome <tsoome@FreeBSD.org>
AuthorDate: 2021-12-26 09:01:16 +0000
Commit:     Toomas Soome <tsoome@FreeBSD.org>
CommitDate: 2022-01-06 11:37:09 +0000

    bhyve smbios type 3 structure is incorrect
    
    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 <rm@fingolfin.org>
    Obtained from:  ilumos
    Differential Revision: https://reviews.freebsd.org/D33682
    
    (cherry picked from 04f55b5b0e8f561aac100083f07df3f570880d69)
---
 usr.sbin/bhyve/smbiostbl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/usr.sbin/bhyve/smbiostbl.c b/usr.sbin/bhyve/smbiostbl.c
index ca68f8d95363..2b12c0b272b0 100644
--- a/usr.sbin/bhyve/smbiostbl.c
+++ b/usr.sbin/bhyve/smbiostbl.c
@@ -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 */
@@ -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 */