kernel/module: Panic if search_module is called during gKernelStartup.

The VFS has not been initialized at this point, so we can't use it.
Should catch #15865.
This commit is contained in:
Augustin Cavalier 2020-04-20 23:47:46 -04:00
parent 12a968998a
commit 0f839b9e8c

View File

@ -624,6 +624,11 @@ search_module(const char* name, module_image** _moduleImage)
TRACE(("search_module(%s)\n", name));
if (gKernelStartup) {
panic("search_module called during kernel startup! name: \"%s\"", name);
return NULL;
}
for (i = kNumModulePaths; i-- > 0;) {
if (sDisableUserAddOns && i >= kFirstNonSystemModulePath)
continue;