sudo kextcache --clear-staging clears /Library/StageExtensions directory

I have a small kernel extension program which was giving an error for no reason, the error is below:

(error code dc00800d: (libkern/kext) authentication failure (file ownership/permissions))

When I did kextutil on my kext I got following error

Kext rejected due to improper filesystem permissions: <OSKext 0x7f8a3dc26480 [0x7fff836acaf0]> { URL = "file:///Library/StagedExtensions/Library/sampleKext/", ID = "com.apple.sampleKext" }

Kext rejected due to improper filesystem permissions: <OSKext 0x7f8a3dc26480 [0x7fff836acaf0]> { URL = "file:///Library/StagedExtensions//Library/sampleKext", ID = "com.apple.sampleKext" }

Diagnostics for /Library/sampleKext:

Authentication Failures:

File owner/permissions are incorrect (must be root:wheel, nonwritable by group/other):

/Library/StagedExtensions/Library/sampleKext

Contents

_CodeSignature

CodeResources

MacOS

sampleKext

Info.plist



I have root:wheel owners, so it should not give me these errors


But after I ran sudo kextcache --clear-staging , it solved my problem.


What does this command do ? There is no documentation for this command.


Does anyone have the solution to my problem?

MacBook Pro, macOS High Sierra (10.13.6), On operating system 10.14

Posted on Nov 20, 2018 2:08 AM

Reply

Similar questions

3 replies

Nov 20, 2018 3:58 AM in response to hrishikeshfromhydera

Looks like the perfect wy to skip Apple approving the kext...

  • run 'sudo rm -rf /Library/GPUBundles/* && sudo kextcache --clear-staging' to restore your system to a state as if SIP had never been enabled for driver installation.
  • run 'sudo rsync -r /System/Library/Extensions/GeForce*Web*.bundle /Library/GPUBundles' to restore to a state as if SIP had been enabled for the most recent driver installation.

https://www.tonymacx86.com/threads/nvidia-releases-alternate-graphics-drivers-fo r-macos-high-sierra-10-13-4-387-10-10-10…

Dec 14, 2018 1:23 PM in response to hrishikeshfromhydera

It seems that 10.14 Mojave copies loaded kernel extensions into a special directory, /Library/StagedExtensions . This directory is highly protected, and its contents cannot be modified... not even by root. I'm guessing this is achieved with some special file attribute.


The error message you're seeing has to do with bad ownership or access permissions on the kext inside /Library/StagedExtensions , not the original kext in /Library/Extensions . Because you can't modify this special, uber-protected directory, you must instead use kextcache --clear-staging as you discovered. This command has the magical powers necessary to wipe out the contents of StagedExtensions so the system can copy the kexts in there again, this time with clean permissions.



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

sudo kextcache --clear-staging clears /Library/StageExtensions directory

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.