HomeFreeBSD

libsa: smbios: Stop parsing on an End-of-Table structure

Description

libsa: smbios: Stop parsing on an End-of-Table structure

This structure exists since SMBIOS v2.2 and indicates that there are no
structures to be parsed beyond this point. For backwards compatibility,
the standard recommends that system software ensures that this structure
covers the rest of the SMBIOS structure table area as reported by the
Structure Table Address, and the Structure Table Maximum Size (64-bit
entry point) or the Structure Table Length (32-bit entry point), which
makes existing parsers continue to work correctly as they usually ignore
unknown structure types. However, this is not a requirement, so be
bullet proof and immediately stop parsing in this case.

Reviewed by: imp, markj
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49285

(cherry picked from commit 7e61fc76400cce08de39adde99b879f0bca21b7d)

Details

Provenance
olceAuthored on Mar 4 2025, 11:17 AM
Reviewer
imp
Differential Revision
D49285: libsa: smbios: Stop parsing on an End-of-Table structure
Parents
rG19a5b6aaab92: libsa: smbios: probe: BCD revision parsing is v2-only code; Expand comments
Branches
Unknown
Tags
Unknown