| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
Decode HPE OEM Record 197: Processor Information
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Functions smbios_decode() and smbios3_decode() include a check
against buffer overrun. This check assumes that the buffer length is
always 32 bytes. This is true when reading from /dev/mem or from a
dump file, however when reading from sysfs, the buffer length is the
size of the actual sysfs attribute file, typically 31 bytes for an
SMBIOS 2.x entry point and 24 bytes for an SMBIOS 3.x entry point.
In the unlikely event of a malformed entry point, with encoded length
larger than expected but smaller than or equal to 32, we would hit a
buffer overrun. So properly pass the actual buffer length as an
argument and perform the check against it.
In practice, this will never happen, because on the Linux kernel
side, the size of the sysfs attribute file is decided from the entry
point length field. So it is technically impossible for them not to
match. But user-space code should not make such assumptions.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use read_file() instead of mem_chunk() to read the entry point from a
dump file. This is faster, and consistent with how we then read the
actual DMI table from that dump file.
This made no functional difference so far, which is why it went
unnoticed for years. But now that a file type check was added to the
mem_chunk() function, we must stop using it to read from regular
files.
This will again allow root to use the --from-dump option.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Jerry Hoemann <jerry.hoemann@hpe.com>
|
|
|
|
|
|
|
|
| |
New firmware type.
(Also remove non-ASCII character in string literal.)
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
| |
Add new location.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
| |
Record type deprecated for Gen11. If record number reused in future,
it will have a different decoding.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
| |
Record type deprecated for Gen9. If record number reused in future,
it will have a different decoding.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
| |
Record type deprecated for Gen8. If record number reused in future,
it will have a different decoding.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
| |
Add new device locations and flag value.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
| |
Decode HPE OEM Record 239: USB Device Correlation Record.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
| |
Add G11 to dmi_hpegen_t.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
|
| |
HPE OEM record type 237 offset 0x09 field was changed from a single
byte STRING to a two byte WORD representing date.
Fixes: cdab638dabb7 ("dmioem: Decode HPE OEM Record 237")
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
|
| |
The OBS armv7l build log shows a lot of warnings about casts increasing
the required alignment of target type. This suggests that this
architecture needs to use the slower byte access which is enabled by
-DALIGNMENT_WORKAROUND.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
| |
Update the NEWS file accordingly.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Building with USE_MMAP unset results in the following warning:
util.c:158:13: warning: ‘safe_memcpy’ defined but not used [-Wunused-function]
static void safe_memcpy(void *dest, const void *src, size_t n)
^~~~~~~~~~~
Only define the function when USE_MMAP is set.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I noticed that the reported ID is different when building dmidecode
in 32-bit mode. The reason is that %lx isn't a valid format to print
a 64-bit integer. It works by accident on 64-bit systems because
types "long integer" and "long long integer" are the same there, but
on 32-bit systems, only the latter can actually store a 64-bit value.
Change the format to %llx so that it works on 32-bit systems too.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Fixes: 90d1323a8d14 ("dmioem: Decode HPE OEM Record 242")
Cc: Jerry Hoemann <jerry.hoemann@hpe.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
While option --dev-mem can be convenient for testing purposes, it
could be abused by attackers to force dmidecode to read a malicious
file. Add a safety check on the type of the mem device file we are
asked to read from. If we are root and this isn't a character device
file, then something is fishy and we better stop.
For non-root users, reading from a regular file is OK and accepted.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
|
|
|
| |
It turns out that variables "offset" and "key" have the same value
for these lines of code, so there is no actual bug, nevertheless
using the right variable makes the code more obviously correct, and
less prone to introduce a bug later when adding support for new
strings.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Tested-by: Jerry Hoemann <jerry.hoemann@hpe.com>
|
|
|
|
|
|
|
|
|
|
| |
Make sure that the file passed to option --dump-bin does not already
exist. In practice, it is rather unlikely that an honest user would
want to overwrite an existing dump file, while this possibility
could be used by a rogue user to corrupt a system file.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Jerry Hoemann <jerry.hoemann@hpe.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When option --dump-bin is used, write the whole dump file at once,
instead of opening and closing the file separately for the table
and then for the entry point.
As the file writing function is no longer generic, it gets moved
from util.c to dmidecode.c.
One minor functional change resulting from the new implementation is
that the entry point is written first now, so the messages printed
are swapped.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Jerry Hoemann <jerry.hoemann@hpe.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clean up function dmi_table so that it does only one thing:
* dmi_table() is renamed to dmi_table_get(). It now retrieves the
DMI table, but does not process it any longer.
* Decoding or dumping the table is now done in smbios3_decode(),
smbios_decode() and legacy_decode().
No functional change.
A side effect of this change is that writing the header and body of
dump files is now done in a single location. This is required to
further consolidate the writing of dump files.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Jerry Hoemann <jerry.hoemann@hpe.com>
|
|
|
|
|
|
|
|
|
|
| |
Print the "Version Data" attribute directly instead of relying on an
intermediate buffer on the stack. While this slightly increases the
binary size, this also makes the code faster, lowers the memory
footprint, and avoids the risk of buffer overrun.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Jerry Hoemann <jerry.hoemann@hpe.com>
|
|
|
|
|
|
|
| |
Decode HPE OEM Record 216: Version Indicator Record.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Back in 2003, I had a system where the CPU type was not set. I added
a quirk so that it would still be recognized as x86, and the CPUID
could be decoded.
A few more exceptions where added over the years, but in effect, the
list was last modified in 2008.
Having such an exception list isn't actually a good idea, for the
following reasons:
* It requires endless maintenance work if we want to keep it
up-to-date.
* It adds some (admittedly minimal) burden to the sane systems.
* If we were to add more entries to the exception list, it wouldn't
scale well (linear algorithmic complexity). This could be improved
but at the cost of more complex code.
* It sends the wrong message to the hardware manufacturers ("You can
get things wrong, we'll add a workaround on our side.")
Therefore I would like to get rid of this exception list. Doing so
has the nice side effect of simplifying the code and making the
binary smaller.
If anyone really needs the CPUID information on such non-compliant
systems, there are other ways to retrieve it, such as lscpu or
/proc/cpuinfo.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
|
| |
This new option is aimed at firmware developers to help them validate
their work. When this option is used, quirks and fixups are disabled
in dmidecode, which will dumbly decode everything found in the table
even if it is known to be incorrect.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
|
|
|
| |
Ensure that the SMBIOS entry point is long enough to include all the
fields we need. Otherwise it is pointless to even attempt to verify
its checksum.
A similar check was added to the SMBIOS entry point parser in the
Linux kernel.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
| |
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Fixes: 3e86b5d3a228 ("dmioem: Decode HPE OEM Record 203")
|
|
|
|
|
|
|
| |
Decode HPE OEM Record 242: Hard Drive Inventory Record
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
| |
Spec was updated to clarify that the device is a USB
Hub for NAND controller. Not the NAND controller itself.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
| |
Decode HPE OEM Record 230: Power Supply Information
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
pr_attr() does not accept a NULL format string. glibc can deal with
it, but FreeBSD's libc chokes on it.
Display the attributes as a list instead. Pack the attribute name and
status into a single formatted string that can be passed to
pr_list_item(). That's arguably a hack, but it's cheap, non-intrusive,
and works nicely in the end.
Bug reported by Scott Benesh (Microchip).
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Fixes: a4b31b2bc537 ("dmioem: Present HPE type 240 attributes in a nicer way")
Cc: Jerry Hoemann <jerry.hoemann@hpe.com>
|
|
|
|
|
|
|
| |
Decode HPE OEM Record 224: Trusted Module (TPM or TCM) Status (Type 224).
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
| |
|
|
|
|
|
| |
Update the NEWS file accordingly, and the AUTHORS file as well to list
all recent contributors.
|
|
|
|
|
|
|
|
|
|
|
| |
The *str = "Reserved" is intended as the default value when index is
outside of the array. str shouldn't retain values from an earlier
invocation of the function.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Fixes: 3e86b5d3a228 ("dmioem: Decode HPE OEM Record 203")
Fixes: 4d8bdbc8b287 ("dmioem: Decode HPE OEM Record 238")
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
| |
While we do not support every piece of the specification yet, the
most needed ones are in place now so it seems reasonable to stop
warning users.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
|
| |
Types 126 and 127 are at the end of the list, their reference section
changes as new structure types are being added to the specification.
Just omit the section number for them, so that we don't have to
update it with every new version of the specification.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
| |
Add types 44, 45 and 46 to dmi_smbios_structure_type().
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
| |
SMBIOS specification 3.5.0 adds a new record type: Firmware Inventory
Information. Add support for it.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
|
|
| |
Version 3.5.0 of the SMBIOS specification added the following:
* BIOS Information: Manufacturing mode flags
* System Slots: Slot height field
* Built-in Pointing Device: 2 new interface types
* Onboard Devices Extended Information: 7 new device types
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
| |
When adding support for SMBIOS 3.4.0, we missed new enumerated
values for the slot type field, and 3 new fields at the end of
System Slots (type 9) structures.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
| |
Let dmi_slot_bus_width() return its value without a trailing space,
so that this function can be reused in a different context.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
| |
Decode HPE OEM Record 237: DIMM Vendor Part Number Information.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
| |
Decode HPE OEM Record 194: Super IO Enable/Disable Features.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
|
| |
Use the standard PCI device format (bus:dev.fn) to designate the
parent PCI device of the USB port, so it is much easier to lookup
in the output of lspci for example.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Jerry Hoemann <jerry.hoemann@hpe.com>
|
|
|
|
|
|
|
| |
Decode HPE OEM Record 238: USB Port Connector Correlation Record.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the preliminary check of HP type 203 records:
* If generation is too old, return 0 so that the raw record will be
displayed.
* If length is too short, still print the record type header.
This is how all other records are handled.
Also drop the duplicate company name in the header.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Jerry Hoemann <jerry.hoemann@hpe.com>
|
|
|
|
|
|
|
|
| |
Decode HPE OEM Record 199: CPU Microcode Patch. Only G9 and later are
supported.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
|
|
|
|
|
|
| |
In order to decode the information from HPE type 199 in a
human-friendly way, we need to know how the CPUID data is encoded.
This depends on the CPU brand and family, so save this information for
later.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|