Lines Matching refs:kext

104  * not work on ARM.  To get around that, we must free prelinked kext
131 /* Any kext will have at least 1 retain for the internal lookup-by-ID dict.
132 * A loaded kext will no dependents or external retains will have 2 retains.
238 // Identifier of kext load requests in sKernelRequests
370 sKernelLogFilter, "kernel kext logging");
455 "Allocated link buffer for kext %s at %p (%lu bytes).",
527 #define notifyKextLoadObservers(kext, kmod_info) \
529 IOStatistics::onKextLoad(kext, kmod_info); \
532 #define notifyKextUnloadObservers(kext) \
534 IOStatistics::onKextUnload(kext); \
537 #define notifyAddClassObservers(kext, addedClass, flags) \
539 IOStatistics::onClassAdded(kext, addedClass); \
542 #define notifyRemoveClassObservers(kext, removedClass, flags) \
544 IOStatistics::onClassRemoved(kext, removedClass); \
549 #define notifyKextLoadObservers(kext, kmod_info)
550 #define notifyKextUnloadObservers(kext)
551 #define notifyAddClassObservers(kext, addedClass, flags)
552 #define notifyRemoveClassObservers(kext, removedClass, flags)
611 OSKextLog(/* kext */ NULL,
614 "Kernel kext log filter 0x%x per kextlog boot arg.",
622 OSKextLog(/* kext */ NULL,
696 /* Add the kernel kext to the bookkeeping dictionaries. Note that
697 * the kernel kext doesn't have a kmod_info struct. copyInfo()
728 OSKextLog(/* kext */ NULL,
772 OSKextLog(/* kext */ NULL,
775 "Jettisoning kext bootstrap segments.");
863 OSKextLog(/* kext */ NULL,
895 OSKextLog(/* kext */ NULL,
929 OSKextLog(/* kext */ NULL,
965 OSKextLog(/* kext */ NULL,
983 * any lingering inter-kext references for nonloaded kexts
1081 OSKextLog(/* kext */ NULL,
1090 OSKextLog(/* kext */ NULL,
1139 OSKextLog(/* kext */ NULL,
1191 OSKextLog(/* kext */ NULL,
1230 OSKextLog(/* kext */ NULL,
1272 OSKextLog(/* kext */ NULL,
1297 "Autounloading for kext %s now %sabled.",
1317 OSKextLog(/* kext */ NULL,
1388 IOLog("kaslr: kext %s \n", getIdentifierCString());
1416 "Kext %s can't find prelinked kext executable size.",
1434 /* If the kext's load address differs from its source address, allocate
1435 * space in the kext map at the load address and copy the kext over.
1455 "Failed to allocate space for prelinked kext %s.",
1463 "Error: prelinked kext %s - source and load addresses "
1496 "Kext %s can't find prelinked kext kmod_info address.",
1530 /* If we created a kext from prelink info,
1597 "No booter-provided data for kext device tree entry %s.",
1602 /* The info plist must exist or we can't read the kext.
1608 "No kext info dictionary for booter device tree entry %s.",
1618 "Can't translate physical address 0x%x of kext info dictionary "
1653 "Can't translate physical address 0x%x of kext bundle path "
1666 "Failed to create wrapper for device tree entry %s kext path %s.",
1684 "Can't translate physical address 0x%x of kext executable "
1702 /* A kext with an executable needs to retain the whole booterData
1709 "Failed to set kext executable for device tree entry %s.",
1744 /* Get the new kext's version for checks & log messages.
1750 /* If we don't have an existing kext with this identifier,
1751 * just record the new kext and we're done!
1760 /* Get the existing kext's version for checks & log messages.
1769 /* If we have a kext with this identifier that's already loaded/prelinked,
1776 * be getting a copy of the kext in the user load request mkext.
1782 /* Only get the UUID if the existing kext is loaded. Doing so
1784 * take that hit when neither kext is loaded.
1793 * - If only one kext has a UUID, they're definitely different.
1804 * are *different* without a lot of work; the loaded kext's
1806 * in-kernel for a prelinked kext). We certainly don't want to do
1807 * a whole fake link for the new kext just to compare, either.
1815 "Notice - new kext %s, v%s matches %s kext "
1826 "Refusing new kext %s, v%s: a %s copy is already present "
1837 "Refusing new kext %s, v%s: already have %s v%s.",
1847 "Refusing new kext %s, v%s: a %s copy with a different "
1859 * kexts needed; so we always accept the new kext (in fact we should never
1869 "Dropping old copy of kext %s (v%s) for newly-added (v%s).",
1877 /* During early boot, the kext with the highest version always wins out.
1888 "Dropping lower version (v%s) of registered kext %s for higher (v%s).",
1925 * Does the bare minimum validation to look up a kext.
1943 panic("Attempt to set info dictionary on a kext "
1964 * in user space, a kext with no bundle identifier gets axed
1973 "CFBundleIdentifier missing/invalid type in kext %s.",
1982 "Can't copy bundle identifier as symbol for kext %s.",
2118 panic("Attempt to set an executable on a kext "
2238 panic("Attempt to free loaded kext %s.", getIdentifierCString());
2276 OSKextLog(/* kext */ NULL,
2287 OSKextLog(/* kext */ NULL,
2295 OSKextLog(/* kext */ NULL,
2309 OSKextLog(/* kext */ NULL,
2364 OSKextLog(/* kext */ NULL,
2380 OSKextLog(/* kext */ NULL,
2399 mkext_kext * kextEntry = &mkextHeader->kext[i];
2403 OSKextLog(/* kext */ NULL,
2416 OSKextLog(/* kext */ NULL,
2437 OSKextLog(/* kext */ NULL,
2446 OSKextLog(/* kext */ NULL,
2475 OSKextLog(/* kext */ NULL,
2487 * kext is a dup. Either way, we don't care here.
2496 /* If we got even one kext out of the mkext archive,
2541 /* If we can't init, remove the kext from the lookup dictionary.
2635 OSKextLog(/* kext */ NULL,
2692 OSKextLog(/* kext */ NULL,
2706 OSKextLog(/* kext */ NULL,
2716 OSKextLog(/* kext */ NULL,
2730 OSKextLog(/* kext */ NULL,
2766 OSKextLog(/* kext */ NULL,
2784 OSKextLog(/* kext */ NULL,
2787 "Mkext archive contains no kext info dictionaries.");
2799 /* Create the kext for the entry, then release it, because the
2800 * kext system keeps them around until explicitly removed.
2931 "Can't create wrapper for mkext file entry '%s' of kext %s.",
3010 * kext plists so we tailor the log messages.
3021 "Allocation failure extracting %s from mkext for kext %s.",
3038 "Allocation failure extracting %s from mkext for kext %s.",
3193 OSKextLog(/* kext */ NULL,
3196 "Received kext load request from user space.");
3199 * user-space program is up and talking to us, so we'll switch our kext
3203 OSKextLog(/* kext */ NULL,
3206 "Switching to late startup (user-space) kext loading policy.");
3212 OSKextLog(/* kext */ NULL,
3228 OSKextLog(/* kext */ NULL,
3231 "Failed to create wrapper for kext load request.");
3238 OSKextLog(/* kext */ NULL,
3241 "Failed to read kext load request.");
3247 OSKextLog(/* kext */ NULL,
3250 "Received kext load request with no predicate; skipping.");
3258 OSKextLog(/* kext */ NULL,
3261 "Received kext load request with no arguments.");
3269 OSKextLog(/* kext */ NULL,
3272 "Received kext load request with no kext identifier.");
3296 OSKextLog(/* kext */ NULL,
3299 "Received request from user space to load kext %s.",
3302 /* Load the kext, with no deferral, since this is a load from outside
3339 /* Note: mkextDataObject will have been retained by every kext w/an
3344 OSKextLog(/* kext */ NULL,
3347 "Kext load request buffer from user space still retained by a kext; "
3378 OSKextLog(/* kext */ NULL,
3389 OSKextLog(/* kext */ NULL,
3398 OSKextLog(/* kext */ NULL,
3410 OSKextLog(/* kext */ NULL,
3537 * xxx - should spawn a separate thread so a kext can safely have
3551 /* If the kext has no identifier, it failed to init
3580 "Can't remove kext %s; services failed to terminate - 0x%x.",
3593 * kext as IOCatalogue::terminateDriversForModule() removes driver
3605 "Removing kext %s.",
3632 OSKextLog(/* kext */ NULL,
3635 "Can't remove kext %s - not found.",
3674 OSKextLog(/* kext */ NULL,
3677 "Can't remove kext with load tag %d - not found.",
3717 * A kext must have a bundle identifier to even survive initialization;
3988 /* An interface kext doesn't have a linked executable with an LC_UUID,
4085 OSKextLog(/* kext (this isn't about a kext) */ NULL,
4163 OSKextLog(/* kext */ NULL,
4166 "Can't load kext %s - not found.",
4175 "Can't load kext %s - requests to user space are disabled.",
4216 OSKextLog(/* kext */ NULL,
4233 "Failed to load kext %s (error 0x%x).",
4284 // xxx - need to find a way to associate this whole func w/the kext
4285 OSKextLog(/* kext */ NULL,
4289 "Recorded kext %s as a candidate for inclusion in prelinked kernel.",
4296 OSKextLog(/* kext */ NULL,
4299 "Failed to record kext %s as a candidate for inclusion in prelinked kernel.",
4338 "Kext loading is disabled (attempt to load kext %s).",
4351 "Can't load kext %s - no more load tags to assign.",
4371 "Can't load kext %s - not loadable during safe boot.",
4379 "Loading kext %s.",
4391 "Can't load kext %s - failed to create link context.",
4407 "Can't load kext %s - failed to resolve library dependencies.",
4413 /* If we are excluding just the kext being loaded now (and not its
4435 "Internal error loading kext %s; dependency disappeared.",
4442 * but not given the personality names of the main kext.
4451 "Dependency %s of kext %s failed to load.",
4470 /* Add the kext to the list of loaded kexts and update the kmod_info
4471 * struct to point to that of the last loaded kext (which is the way
4489 /* Make the global kmod list point at the just-loaded kext. Note that the
4490 * __kernel__ kext isn't in this list, as it wasn't before SnowLeopard,
4541 /* More hack! If the kext doesn't declare an executable, even if we
4546 * Note that in every other regard it's perfectly ok for a kext to
4548 * naming another kext, so we do have to allow such kexts to be "loaded"
4695 "Sliding kext %s: External relocations found.",
4705 "Sliding kext %s: No linkedit segment.",
4715 "Sliding kext %s: No writable segments.",
4717 "Sliding kext %s: No segments.",
4737 "Sliding kext %s: Unexpected relocation found.",
4786 /* Create a new OSData for the smaller kext object and reflect
4889 "Can't load kext %s - executable is missing.",
4915 "Can't allocate link dependencies to load kext %s.",
4932 "Can't load kext %s - it has no library dependencies.",
4942 "Can't allocate link context to load kext %s.",
4974 kxlddeps[i].kext = (u_char *) interfaceTarget->getBytesNoCopy();
4982 kxlddeps[i].kext = (u_char *) dependency->linkedExecutable->getBytesNoCopy();
5022 "Can't load kext %s - link failed.",
5040 /* Whip up a fake kmod_info entry for the interface kext.
5054 /* An interface kext doesn't have a linkedExecutable, so save a
5143 "Failed to load executable for kext %s.",
5164 * The linkedit segment is used by the kext linker for dependency
5180 * support runtime kext linking.
5190 * it will fragment the kext into multiple VM regions, which OSKext is not
5204 /* Create a new OSData for the smaller kext object.
5241 panic("Attempt to set linked executable on kext "
5290 /* Register kext with dtrace. A dtrace_modload failure should not
5291 * prevent a kext from loading, so we ignore the return code.
5311 /* Unregister kext with dtrace. A dtrace_modunload failure should not
5312 * prevent a kext from loading, so we ignore the return code.
5390 /* Get the kext's vm map */
5507 /* Verify that the start/stop function lies within the kext's address range.
5515 "Kext %s module %s pointer is outside of kext range "
5516 "(%s %p - kext at %p-%p)..",
5528 * If anything goes wrong with the mapping while the kext is running,
5529 * we'll likely have panicked well before any attempt to stop the kext.
5561 /* Verify that the kext's segments are backed by physical memory.
5624 "Attempt to start nonloaded kext %s.",
5634 "Kext loading is disabled (attempt to start kext %s).",
5801 "Attempt to stop nonloaded kext %s.",
5834 * we stop & unload the kext or not.
5910 "Can't unload kext %s; outstanding references (linkage or tracking object).",
5920 "Can't unload kext %s; classes have instances:",
5938 /* Note that the kext is unloading before running any code that
5939 * might be in the kext (request callbacks, module stop function).
5940 * We will deny certain requests made against a kext in the process
5945 /* Update the string describing the last kext to unload in case we panic.
5969 * have no OSMetaClass references before unloading the kext executable
5970 * from memory. OSMetaClasses may have pointers into the kext executable
5977 /* Remove the kext from the list of loaded kexts, patch the gap
5979 * last loaded kext that isn't the fake kernel kext (sKernelKext).
6041 "Failed to free kext %s; couldn't find the kext map.",
6062 "Failed to unwire kext %s.",
6076 /* An interface kext has a fake kmod_info that was allocated,
6089 * rebuild the kernel cache file. If a kext was already in the kernel
6194 OSKextLog(/* kext */ NULL,
6197 "thread_call_free() failed for kext link context.");
6236 OSKextLog(/* kext */ NULL,
6238 "Can't create thread to destroy kext link context.");
6253 * This is a static method because the kext will be deallocated if it
6262 /* Check for external references to this kext (usu. dependents),
6273 /* Skip a delay-autounload kext, once.
6317 /* If there is an old kext summary, free that now.
6334 OSKextLog(/* kext */ NULL,
6368 * check whether a kext will unload. If only we could have
6422 OSKextLog(/* kext */ NULL,
6524 OSKextLog(/* kext */ NULL,
6554 * We will rebuild if any kext is not marked prelinked AND is not in our
6573 /* kext is loaded and was not in current kernel cache so let's rebuild
6576 OSKextLog(/* kext */ NULL,
6633 * and a loaded kext should also have it set (as should all its
6760 "Kext %s - library kext %s not found.",
6769 "Kext %s - library kext %s not compatible "
6777 * prelinked kext, at any point in the chain, we must fail
6787 "Kext %s (prelinked) - library kext %s (v%s) not prelinked.",
6799 * *its* dependencies on the list for this kext.
6823 // xxx - this msg level should be 1 lower than the per-kext one
6866 "Error - kext %s declares a dependency on %s, which is not permitted.",
6875 "Error - kext %s declares %s dependencies. "
6884 "Warning - kext %s declares no %s* dependencies. "
6897 "Warning - kext %s has immediate dependencies on both "
6922 /* If the kext doesn't have a raw kernel or KPI dependency, then add all of
6970 "Error - kext %s declares a dependency on %s. "
7052 /* Only clear the dependencies if the kext isn't loaded;
7117 "Notice - kext %s has already registered class %s.",
7187 "Notice - kext %s asked to unregister unknown class %s.",
7212 "Failed to unregister kext %s class %s.",
7371 OSKextLog(/* kext */ NULL,
7390 OSKextLog(/* kext */ NULL,
7401 OSKextLog(/* kext */ NULL,
7404 "Recieved kext request from user space with no predicate.");
7409 OSKextLog(/* kext */ NULL,
7420 /* must be root to use these kext requests */
7422 OSKextLog(/* kext */ NULL,
7447 OSKextLog(/* kext */ NULL,
7450 "Invalid arguments to kext start request.");
7452 OSKextLog(/* kext */ NULL,
7464 OSKextLog(/* kext */ NULL,
7467 "Invalid arguments to kext stop request.");
7469 OSKextLog(/* kext */ NULL,
7481 OSKextLog(/* kext */ NULL,
7484 "Invalid arguments to kext unload request.");
7486 OSKextLog(/* kext */ NULL,
7523 OSKextLog(/* kext */ NULL,
7526 "Invalid arguments to kext info request.");
7534 OSKextLog(/* kext */ NULL,
7537 "Invalid arguments to kext info request.");
7547 OSKextLog(/* kext */ NULL,
7550 "Returning loaded kext info.");
7559 OSKextLog(/* kext */ NULL,
7567 OSKextLog(/* kext */ NULL,
7586 OSKextLog(/* kext */ NULL,
7597 OSKextLog(/* kext */ NULL,
7613 OSKextLog(/* kext */ NULL,
7616 "Request from user space still retained by a kext; "
7621 OSKextLog(/* kext */ NULL,
7640 OSKextLog(/* kext */ NULL,
7660 OSKextLog(/* kext */ NULL,
7748 /* Skip current kext if we have a list of bundle IDs and
7872 OSKextLog(/* kext */ NULL,
7978 /* UUID, if the kext has one.
8245 OSKextLog(/* kext */ NULL,
8261 OSKextLog(/* kext */ NULL,
8268 OSKextLog(/* kext */ NULL,
8270 "Resource request callback is in a kext that is not started.");
8275 /* Do not allow any new requests to be made on a kext that is unloading.
8286 OSKextLog(/* kext */ NULL,
8546 OSKextLog(/* kext */ NULL,
8552 OSKextLog(/* kext */ NULL,
8554 "Can't invoke kext resource callback; ");
8965 /* Let's conservatively guess that any given kext has around 3
9025 OSKextLog(/* kext */ NULL,
9041 OSKextLog(/* kext */ NULL,
9044 "%d kext personalit%s sent to the IOCatalogue; %s.",
9088 * differs from the kext's, insert the kext's ID so we can find it.
9127 "Kext loading is disabled (attempt to start matching for kext %s).",
9192 * xxx - We should allow removing the kext's declared personalities,
9212 /* Have the IOCatalog remove all personalities matching this kext's
9268 OSKextLog(/* kext */ NULL,
9275 OSKextLog(/* kext */ NULL,
9318 OSKextLog(/* kext */ NULL,
9421 /* A verbose message that isn't for a logging-enabled kext and isn't global
9475 /* Set the kext/global bit in the message spec if we have no
9476 * kext or if the kext requests logging.
9657 // IOLog("found OSData %p in kext map %p to %p \n",
9664 IOLog("found addr %p from an OSData obj within kext \"%s\" \n",
9699 IOLog("found OSNumber in kext map %p to %p \n",
9706 IOLog("found in kext \"%s\" \n",
9767 (*printf_func)(" can't perform kext scan: no kext summary");
9775 (*printf_func)(" can't perform kext scan: "
9776 "missing kext summary page %p", summary_page);
9834 * scan list of loaded kext summaries looking for a load address match and if
10093 "NULL kext in loaded kext list; continuing\n");
10099 "Kext type cast failed in loaded kext list; continuing\n");
10129 printf("kext scan stopped due to missing kmod_info page: %p\n",
10138 printf("error saving loaded kext info\n");
10178 OSKextLog(/* kext */ NULL,
10180 "Couldn't allocate kext panic log buffer.");
10231 printf("error saving unloaded kext info\n");
10258 printf_func("last loaded kext at %llu: %.*s (addr %p, size %lu)\n",
10265 printf_func("last unloaded kext at %llu: %.*s (addr %p, size %lu)\n",
10352 /* Populate each kext summary.