Lines Matching refs:kext

109  * 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.
239 // Identifier of kext load requests in sKernelRequests
373 sKernelLogFilter, "kernel kext logging");
457 "Allocated link buffer for kext %s at %p (%lu bytes).",
529 #define notifyKextLoadObservers(kext, kmod_info) \
531 IOStatistics::onKextLoad(kext, kmod_info); \
534 #define notifyKextUnloadObservers(kext) \
536 IOStatistics::onKextUnload(kext); \
539 #define notifyAddClassObservers(kext, addedClass, flags) \
541 IOStatistics::onClassAdded(kext, addedClass); \
544 #define notifyRemoveClassObservers(kext, removedClass, flags) \
546 IOStatistics::onClassRemoved(kext, removedClass); \
551 #define notifyKextLoadObservers(kext, kmod_info)
552 #define notifyKextUnloadObservers(kext)
553 #define notifyAddClassObservers(kext, addedClass, flags)
554 #define notifyRemoveClassObservers(kext, removedClass, flags)
613 OSKextLog(/* kext */ NULL,
616 "Kernel kext log filter 0x%x per kextlog boot arg.",
624 OSKextLog(/* kext */ NULL,
698 /* Add the kernel kext to the bookkeeping dictionaries. Note that
699 * the kernel kext doesn't have a kmod_info struct. copyInfo()
730 OSKextLog(/* kext */ NULL,
774 OSKextLog(/* kext */ NULL,
777 "Jettisoning kext bootstrap segments.");
857 OSKextLog(/* kext */ NULL,
889 OSKextLog(/* kext */ NULL,
923 OSKextLog(/* kext */ NULL,
959 OSKextLog(/* kext */ NULL,
977 * any lingering inter-kext references for nonloaded kexts
1075 OSKextLog(/* kext */ NULL,
1084 OSKextLog(/* kext */ NULL,
1133 OSKextLog(/* kext */ NULL,
1185 OSKextLog(/* kext */ NULL,
1224 OSKextLog(/* kext */ NULL,
1266 OSKextLog(/* kext */ NULL,
1291 "Autounloading for kext %s now %sabled.",
1311 OSKextLog(/* kext */ NULL,
1382 IOLog("kaslr: kext %s \n", getIdentifierCString());
1410 "Kext %s can't find prelinked kext executable size.",
1428 /* If the kext's load address differs from its source address, allocate
1429 * space in the kext map at the load address and copy the kext over.
1449 "Failed to allocate space for prelinked kext %s.",
1457 "Error: prelinked kext %s - source and load addresses "
1489 "Kext %s can't find prelinked kext kmod_info address.",
1523 /* If we created a kext from prelink info,
1590 "No booter-provided data for kext device tree entry %s.",
1595 /* The info plist must exist or we can't read the kext.
1601 "No kext info dictionary for booter device tree entry %s.",
1611 "Can't translate physical address 0x%x of kext info dictionary "
1646 "Can't translate physical address 0x%x of kext bundle path "
1659 "Failed to create wrapper for device tree entry %s kext path %s.",
1677 "Can't translate physical address 0x%x of kext executable "
1695 /* A kext with an executable needs to retain the whole booterData
1702 "Failed to set kext executable for device tree entry %s.",
1737 /* Get the new kext's version for checks & log messages.
1743 /* If we don't have an existing kext with this identifier,
1744 * just record the new kext and we're done!
1753 /* Get the existing kext's version for checks & log messages.
1762 /* If we have a kext with this identifier that's already loaded/prelinked,
1769 * be getting a copy of the kext in the user load request mkext.
1775 /* Only get the UUID if the existing kext is loaded. Doing so
1777 * take that hit when neither kext is loaded.
1786 * - If only one kext has a UUID, they're definitely different.
1797 * are *different* without a lot of work; the loaded kext's
1799 * in-kernel for a prelinked kext). We certainly don't want to do
1800 * a whole fake link for the new kext just to compare, either.
1808 "Notice - new kext %s, v%s matches %s kext "
1819 "Refusing new kext %s, v%s: a %s copy is already present "
1830 "Refusing new kext %s, v%s: already have %s v%s.",
1840 "Refusing new kext %s, v%s: a %s copy with a different "
1852 * kexts needed; so we always accept the new kext (in fact we should never
1862 "Dropping old copy of kext %s (v%s) for newly-added (v%s).",
1870 /* During early boot, the kext with the highest version always wins out.
1881 "Dropping lower version (v%s) of registered kext %s for higher (v%s).",
1918 * Does the bare minimum validation to look up a kext.
1936 panic("Attempt to set info dictionary on a kext "
1957 * in user space, a kext with no bundle identifier gets axed
1966 "CFBundleIdentifier missing/invalid type in kext %s.",
1975 "Can't copy bundle identifier as symbol for kext %s.",
2051 /* Check to see if this kext is in exclude list */
2120 panic("Attempt to set an executable on a kext "
2240 panic("Attempt to free loaded kext %s.", getIdentifierCString());
2278 OSKextLog(/* kext */ NULL,
2289 OSKextLog(/* kext */ NULL,
2297 OSKextLog(/* kext */ NULL,
2309 OSKextLog(/* kext */ NULL,
2366 OSKextLog(/* kext */ NULL,
2380 OSKextLog(/* kext */ NULL,
2390 OSKextLog(/* kext */ NULL,
2404 OSKextLog(/* kext */ NULL,
2440 OSKextLog(/* kext */ NULL,
2458 OSKextLog(/* kext */ NULL,
2461 "Mkext archive contains no kext info dictionaries.");
2473 /* Create the kext for the entry, then release it, because the
2474 * kext system keeps them around until explicitly removed.
2605 "Can't create wrapper for mkext file entry '%s' of kext %s.",
2697 * kext plists so we tailor the log messages.
2708 "Allocation failure extracting %s from mkext for kext %s.",
2725 "Allocation failure extracting %s from mkext for kext %s.",
2880 OSKextLog(/* kext */ NULL,
2883 "Received kext load request from user space.");
2886 * user-space program is up and talking to us, so we'll switch our kext
2890 OSKextLog(/* kext */ NULL,
2893 "Switching to late startup (user-space) kext loading policy.");
2899 OSKextLog(/* kext */ NULL,
2915 OSKextLog(/* kext */ NULL,
2918 "Failed to create wrapper for kext load request.");
2925 OSKextLog(/* kext */ NULL,
2928 "Failed to read kext load request.");
2934 OSKextLog(/* kext */ NULL,
2937 "Received kext load request with no predicate; skipping.");
2945 OSKextLog(/* kext */ NULL,
2948 "Received kext load request with no arguments.");
2956 OSKextLog(/* kext */ NULL,
2959 "Received kext load request with no kext identifier.");
2983 OSKextLog(/* kext */ NULL,
2986 "Received request from user space to load kext %s.",
2989 /* Load the kext, with no deferral, since this is a load from outside
3026 /* Note: mkextDataObject will have been retained by every kext w/an
3031 OSKextLog(/* kext */ NULL,
3034 "Kext load request buffer from user space still retained by a kext; "
3065 OSKextLog(/* kext */ NULL,
3076 OSKextLog(/* kext */ NULL,
3085 OSKextLog(/* kext */ NULL,
3097 OSKextLog(/* kext */ NULL,
3227 * xxx - should spawn a separate thread so a kext can safely have
3245 /* If the kext has no identifier, it failed to init
3273 "Failed to remove kext %s (MAC policy error 0x%x).",
3291 "Can't remove kext %s; services failed to terminate - 0x%x.",
3304 * kext as IOCatalogue::terminateDriversForModule() removes driver
3316 "Removing kext %s.",
3343 OSKextLog(/* kext */ NULL,
3346 "Can't remove kext %s - not found.",
3385 OSKextLog(/* kext */ NULL,
3388 "Can't remove kext with load tag %d - not found.",
3444 /* look for AppleKextExcludeList.kext */
3460 /* Make sure it is a kext */
3466 "\"%s\" not a kext",
3593 * A kext must have a bundle identifier to even survive initialization;
3861 /* An interface kext doesn't have a linked executable with an LC_UUID,
3963 OSKextLog(/* kext (this isn't about a kext) */ NULL,
3988 * key = bundleID string of kext we will not allow to load
3989 * value = version string(s) of the kext that is to be denied loading.
3990 * The version strings can be comma delimited. For example if kext
3995 * not load the kext.
4147 OSKextLog(/* kext */ NULL,
4150 "Can't load kext %s - not found.",
4159 "Can't load kext %s - requests to user space are disabled.",
4200 OSKextLog(/* kext */ NULL,
4217 "Failed to load kext %s (error 0x%x).",
4268 // xxx - need to find a way to associate this whole func w/the kext
4269 OSKextLog(/* kext */ NULL,
4273 "Recorded kext %s as a candidate for inclusion in prelinked kernel.",
4280 OSKextLog(/* kext */ NULL,
4283 "Failed to record kext %s as a candidate for inclusion in prelinked kernel.",
4342 "Failed to load kext %s (MAC policy error 0x%x).",
4353 "Kext loading is disabled (attempt to load kext %s).",
4366 "Can't load kext %s - no more load tags to assign.",
4386 "Can't load kext %s - not loadable during safe boot.",
4394 "Loading kext %s.",
4405 "Can't load kext %s - failed to create link context.",
4421 "Can't load kext %s - failed to resolve library dependencies.",
4427 /* If we are excluding just the kext being loaded now (and not its
4449 "Internal error loading kext %s; dependency disappeared.",
4456 * but not given the personality names of the main kext.
4465 "Dependency %s of kext %s failed to load.",
4484 /* Add the kext to the list of loaded kexts and update the kmod_info
4485 * struct to point to that of the last loaded kext (which is the way
4503 /* Make the global kmod list point at the just-loaded kext. Note that the
4504 * __kernel__ kext isn't in this list, as it wasn't before SnowLeopard,
4554 /* More hack! If the kext doesn't declare an executable, even if we
4559 * Note that in every other regard it's perfectly ok for a kext to
4561 * naming another kext, so we do have to allow such kexts to be "loaded"
4711 "Sliding kext %s: External relocations found.",
4721 "Sliding kext %s: No linkedit segment.",
4731 "Sliding kext %s: No writable segments.",
4733 "Sliding kext %s: No segments.",
4750 "Sliding kext %s: Unexpected relocation found.",
4799 /* Create a new OSData for the smaller kext object and reflect
4907 "Can't load kext %s - executable is missing.",
4933 "Can't allocate link dependencies to load kext %s.",
4950 "Can't load kext %s - it has no library dependencies.",
4960 "Can't allocate link context to load kext %s.",
4992 kxlddeps[i].kext = (u_char *) interfaceTarget->getBytesNoCopy();
5000 kxlddeps[i].kext = (u_char *) dependency->linkedExecutable->getBytesNoCopy();
5040 "Can't load kext %s - link failed.",
5058 /* Whip up a fake kmod_info entry for the interface kext.
5072 /* An interface kext doesn't have a linkedExecutable, so save a
5161 "Failed to load executable for kext %s.",
5182 * The linkedit segment is used by the kext linker for dependency
5197 /* We don't currently guarantee alignment greater than 4KB for kext
5206 * support runtime kext linking.
5216 * it will fragment the kext into multiple VM regions, which OSKext is not
5230 /* Create a new OSData for the smaller kext object.
5273 panic("Attempt to set linked executable on kext "
5322 /* Register kext with dtrace. A dtrace_modload failure should not
5323 * prevent a kext from loading, so we ignore the return code.
5343 /* Unregister kext with dtrace. A dtrace_modunload failure should not
5344 * prevent a kext from loading, so we ignore the return code.
5401 /* Get the kext's vm map */
5518 /* Verify that the start/stop function lies within the kext's address range.
5526 "Kext %s module %s pointer is outside of kext range "
5527 "(%s %p - kext at %p-%p)..",
5539 * If anything goes wrong with the mapping while the kext is running,
5540 * we'll likely have panicked well before any attempt to stop the kext.
5572 /* Verify that the kext's segments are backed by physical memory.
5637 "Attempt to start nonloaded kext %s.",
5647 "Kext loading is disabled (attempt to start kext %s).",
5814 "Attempt to stop nonloaded kext %s.",
5847 * we stop & unload the kext or not.
5923 "Can't unload kext %s; outstanding references (linkage or tracking object).",
5933 "Can't unload kext %s; classes have instances:",
5951 /* Note that the kext is unloading before running any code that
5952 * might be in the kext (request callbacks, module stop function).
5953 * We will deny certain requests made against a kext in the process
5958 /* Update the string describing the last kext to unload in case we panic.
5982 * have no OSMetaClass references before unloading the kext executable
5983 * from memory. OSMetaClasses may have pointers into the kext executable
5990 /* Remove the kext from the list of loaded kexts, patch the gap
5992 * last loaded kext that isn't the fake kernel kext (sKernelKext).
6054 "Failed to free kext %s; couldn't find the kext map.",
6075 "Failed to unwire kext %s.",
6089 /* An interface kext has a fake kmod_info that was allocated,
6102 * rebuild the kernel cache file. If a kext was already in the kernel
6207 OSKextLog(/* kext */ NULL,
6210 "thread_call_free() failed for kext link context.");
6249 OSKextLog(/* kext */ NULL,
6251 "Can't create thread to destroy kext link context.");
6266 * This is a static method because the kext will be deallocated if it
6275 /* Check for external references to this kext (usu. dependents),
6286 /* Skip a delay-autounload kext, once.
6333 OSKextLog(/* kext */ NULL,
6366 * check whether a kext will unload. If only we could have
6420 OSKextLog(/* kext */ NULL,
6522 OSKextLog(/* kext */ NULL,
6552 * We will rebuild if any kext is not marked prelinked AND is not in our
6571 /* kext is loaded and was not in current kernel cache so let's rebuild
6574 OSKextLog(/* kext */ NULL,
6631 * and a loaded kext should also have it set (as should all its
6758 "Kext %s - library kext %s not found.",
6767 "Kext %s - library kext %s not compatible "
6775 * prelinked kext, at any point in the chain, we must fail
6785 "Kext %s (prelinked) - library kext %s (v%s) not prelinked.",
6797 * *its* dependencies on the list for this kext.
6821 // xxx - this msg level should be 1 lower than the per-kext one
6864 "Error - kext %s declares a dependency on %s, which is not permitted.",
6873 "Error - kext %s declares %s dependencies. "
6882 "Warning - kext %s declares no %s* dependencies. "
6895 "Warning - kext %s has immediate dependencies on both "
6920 /* If the kext doesn't have a raw kernel or KPI dependency, then add all of
6968 "Error - kext %s declares a dependency on %s. "
7050 /* Only clear the dependencies if the kext isn't loaded;
7115 "Notice - kext %s has already registered class %s.",
7185 "Notice - kext %s asked to unregister unknown class %s.",
7210 "Failed to unregister kext %s class %s.",
7366 OSKextLog(/* kext */ NULL,
7385 OSKextLog(/* kext */ NULL,
7396 OSKextLog(/* kext */ NULL,
7399 "Recieved kext request from user space with no predicate.");
7404 OSKextLog(/* kext */ NULL,
7412 /* must be root to use these kext requests */
7418 OSKextLog(/* kext */ NULL,
7442 OSKextLog(/* kext */ NULL,
7445 "Invalid arguments to kext start request.");
7447 OSKextLog(/* kext */ NULL,
7459 OSKextLog(/* kext */ NULL,
7462 "Invalid arguments to kext stop request.");
7464 OSKextLog(/* kext */ NULL,
7476 OSKextLog(/* kext */ NULL,
7479 "Invalid arguments to kext unload request.");
7481 OSKextLog(/* kext */ NULL,
7518 OSKextLog(/* kext */ NULL,
7521 "Invalid arguments to kext info request.");
7529 OSKextLog(/* kext */ NULL,
7532 "Invalid arguments to kext info request.");
7542 OSKextLog(/* kext */ NULL,
7545 "Returning loaded kext info.");
7556 OSKextLog(/* kext */ NULL,
7567 OSKextLog(/* kext */ NULL,
7574 OSKextLog(/* kext */ NULL,
7591 OSKextLog(/* kext */ NULL,
7594 "Request from user space still retained by a kext; "
7606 OSKextLog(/* kext */ NULL,
7625 OSKextLog(/* kext */ NULL,
7715 /* Skip current kext if we have a list of bundle IDs and
7839 OSKextLog(/* kext */ NULL,
7945 /* UUID, if the kext has one.
8212 OSKextLog(/* kext */ NULL,
8228 OSKextLog(/* kext */ NULL,
8235 OSKextLog(/* kext */ NULL,
8237 "Resource request callback is in a kext that is not started.");
8242 /* Do not allow any new requests to be made on a kext that is unloading.
8253 OSKextLog(/* kext */ NULL,
8513 OSKextLog(/* kext */ NULL,
8519 OSKextLog(/* kext */ NULL,
8521 "Can't invoke kext resource callback; ");
8930 /* Let's conservatively guess that any given kext has around 3
8990 OSKextLog(/* kext */ NULL,
9006 OSKextLog(/* kext */ NULL,
9009 "%d kext personalit%s sent to the IOCatalogue; %s.",
9053 * differs from the kext's, insert the kext's ID so we can find it.
9092 "Kext loading is disabled (attempt to start matching for kext %s).",
9157 * xxx - We should allow removing the kext's declared personalities,
9177 /* Have the IOCatalog remove all personalities matching this kext's
9233 OSKextLog(/* kext */ NULL,
9240 OSKextLog(/* kext */ NULL,
9283 OSKextLog(/* kext */ NULL,
9386 /* A verbose message that isn't for a logging-enabled kext and isn't global
9440 /* Set the kext/global bit in the message spec if we have no
9441 * kext or if the kext requests logging.
9622 // IOLog("found OSData %p in kext map %p to %p \n",
9629 IOLog("found addr %p from an OSData obj within kext \"%s\" \n",
9664 IOLog("found OSNumber in kext map %p to %p \n",
9671 IOLog("found in kext \"%s\" \n",
9733 (*printf_func)(" can't perform kext scan: no kext summary");
9741 (*printf_func)(" can't perform kext scan: "
9742 "missing kext summary page %p", summary_page);
9800 * scan list of loaded kext summaries looking for a load address match and if
10079 "NULL kext in loaded kext list; continuing\n");
10085 "Kext type cast failed in loaded kext list; continuing\n");
10115 printf("kext scan stopped due to missing kmod_info page: %p\n",
10124 printf("error saving loaded kext info\n");
10165 OSKextLog(/* kext */ NULL,
10167 "Couldn't allocate kext panic log buffer.");
10222 printf("error saving unloaded kext info\n");
10249 printf_func("last loaded kext at %llu: %.*s (addr %p, size %lu)\n",
10256 printf_func("last unloaded kext at %llu: %.*s (addr %p, size %lu)\n",
10354 /* Populate each kext summary.