Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F133175642
D14759.id40468.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
D14759.id40468.diff
View Options
Index: sys/dev/efidev/efirt.c
===================================================================
--- sys/dev/efidev/efirt.c
+++ sys/dev/efidev/efirt.c
@@ -99,6 +99,25 @@
static struct mtx efi_lock;
+static bool
+efi_is_in_map(struct efi_md *map, int ndesc, int descsz, vm_offset_t addr)
+{
+ struct efi_md *p;
+ int i;
+
+ for (i = 0, p = map; i < ndesc; i++, p = efi_next_descriptor(p,
+ descsz)) {
+ if ((p->md_attr & EFI_MD_ATTR_RT) == 0)
+ continue;
+
+ if (addr >= (uint64_t)p->md_virt &&
+ addr < (uint64_t)p->md_virt + p->md_pages * PAGE_SIZE)
+ return (true);
+ }
+
+ return (false);
+}
+
static int
efi_init(void)
{
@@ -164,6 +183,16 @@
return (ENXIO);
}
+ if (!efi_is_in_map(map, efihdr->memory_size / efihdr->descriptor_size,
+ efihdr->descriptor_size, (vm_offset_t)efi_runtime->rt_gettime)) {
+ if (bootverbose)
+ printf(
+ "EFI runtime services table has an invalid pointer\n");
+ efi_runtime = NULL;
+ efi_destroy_1t1_map();
+ return (ENXIO);
+ }
+
return (0);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Oct 24, 4:48 PM (15 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
24137383
Default Alt Text
D14759.id40468.diff (1 KB)
Attached To
Mode
D14759: Check if the gettime runtime service is valid
Attached
Detach File
Event Timeline
Log In to Comment