Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102530049
D40034.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D40034.diff
View Options
diff --git a/usr.sbin/bhyve/e820.c b/usr.sbin/bhyve/e820.c
--- a/usr.sbin/bhyve/e820.c
+++ b/usr.sbin/bhyve/e820.c
@@ -197,11 +197,17 @@
return (0);
}
- assert(element != NULL);
- /* Non system memory should be allocated inside system memory. */
- assert(element->type == E820_TYPE_MEMORY);
- /* New element should fit into existing system memory element. */
- assert(base >= element->base && end <= element->end);
+ /*
+ * If some one tries to allocate a specific address, it could happen, that
+ * this address is not allocatable. Therefore, do some checks. If the
+ * address is not allocatable, don't panic. The user may have a fallback and
+ * tries to allocate another address. This is true for the GVT-d emulation
+ * which tries to reuse the host address of the graphics stolen memory and
+ * falls back to allocating the highest address below 4 GB.
+ */
+ if (element == NULL || element->type != E820_TYPE_MEMORY ||
+ (base < element->base || end > element->end))
+ return (ENOMEM);
if (base == element->base) {
/*
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 14, 3:59 PM (1 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14630911
Default Alt Text
D40034.diff (1 KB)
Attached To
Mode
D40034: bhyve: don't panic if e820 finds no available memory
Attached
Detach File
Event Timeline
Log In to Comment