Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F145054430
D30050.1777289991.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
881 B
Referenced Files
None
Subscribers
None
D30050.1777289991.diff
View Options
Index: usr.sbin/bhyve/bhyverun.c
===================================================================
--- usr.sbin/bhyve/bhyverun.c
+++ usr.sbin/bhyve/bhyverun.c
@@ -69,6 +69,7 @@
#include <sysexits.h>
#include <stdbool.h>
#include <stdint.h>
+#include <uuid.h>
#ifdef BHYVE_SNAPSHOT
#include <ucl.h>
#include <unistd.h>
@@ -1077,6 +1078,16 @@
fbsdrun_addcpu(ctx, BSP, vcpu, rip);
}
+bool
+is_valid_uuid(const char* uuid_str)
+{
+ uuid_t uuid;
+ uint32_t uuid_status;
+
+ uuid_from_string(uuid_str, &uuid, &uuid_status);
+ return uuid_status == uuid_s_ok;
+}
+
int
main(int argc, char *argv[])
{
@@ -1196,7 +1207,10 @@
rtc_localtime = 0;
break;
case 'U':
- guest_uuid_str = optarg;
+ if (is_valid_uuid(optarg) == false) {
+ errx(EX_USAGE, "invalid UUID '%s'", optarg);
+ }
+ guest_uuid_str = optarg;
break;
case 'w':
strictmsr = 0;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 27, 11:39 AM (19 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28439232
Default Alt Text
D30050.1777289991.diff (881 B)
Attached To
Mode
D30050: Adds uuid validation to bhyve(8) arg parsing
Attached
Detach File
Event Timeline
Log In to Comment