diff options
author | James Mintram <me@jamesrm.com> | 2022-06-16 20:17:44 +0000 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2023-01-26 19:28:56 +0000 |
commit | 0e81a14657d0f9d6ae3de6b1cf5f8705a1b31993 (patch) | |
tree | bd9e736365a6676d21c8d658bf19d4df722369c7 | |
parent | 18003eb854e89b19dcfa4bdd09474bd664b5b116 (diff) | |
download | src-0e81a14657d0f9d6ae3de6b1cf5f8705a1b31993.tar.gz src-0e81a14657d0f9d6ae3de6b1cf5f8705a1b31993.zip |
bhyve: Report an error for invalid UUIDs.
Reviewed by: rgrimes, grehan, jhb
Differential Revision: https://reviews.freebsd.org/D30050
(cherry picked from commit e16b709e2dcc45f01cf96b5e7f6d48474feff8d7)
-rw-r--r-- | usr.sbin/bhyve/bhyverun.c | 3 | ||||
-rw-r--r-- | usr.sbin/bhyve/smbiostbl.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c index 70dd52c9b2b4..453c24794907 100644 --- a/usr.sbin/bhyve/bhyverun.c +++ b/usr.sbin/bhyve/bhyverun.c @@ -1558,7 +1558,8 @@ main(int argc, char *argv[]) } error = smbios_build(ctx); - assert(error == 0); + if (error != 0) + exit(4); if (get_config_bool("acpi_tables")) { error = acpi_build(ctx, guest_ncpus); diff --git a/usr.sbin/bhyve/smbiostbl.c b/usr.sbin/bhyve/smbiostbl.c index ab8dfeeb532b..cafb0343519f 100644 --- a/usr.sbin/bhyve/smbiostbl.c +++ b/usr.sbin/bhyve/smbiostbl.c @@ -671,8 +671,10 @@ smbios_type1_initializer(const struct smbios_structure *template_entry, uint32_t status; uuid_from_string(guest_uuid_str, &uuid, &status); - if (status != uuid_s_ok) + if (status != uuid_s_ok) { + EPRINTLN("Invalid UUID"); return (-1); + } uuid_enc_le(&type1->uuid, &uuid); } else { |