Kext unload issues with kext with multiple classes
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=vYeBC6AU0mLzIUsg0KzhMFp62Cn4KxSjAbKd+caKHSg=; b=JmwHAujp4QidhXvpqoKLnvDmdGAp/j62z6v8qopNu8cnnJjiv9S+4q2NLwbqom+kUf opLo/aJpMC3Rudrhv7n1Is72xnYDfLwDtME6KU8p1dPQOGGC4VMDg1ZrFcJbM/qXRorF /9qHBEaxJ/yaZoa0p1jPQT1Zzd6wNgfWUMJP4= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=uIuNndobGcnNu/i8R9s6NHAwduSBS1d++TrqVcMJP1xeGxfl505retAuFunMw26zDq +Sk5RJ/rlNsVHQqa89vDAsocbxo18e/w0pDYIA6na75UoEl9z3dKASxVRkJaBZ1Y5akz PvEABSPXU+P/5HXGImp1eZ52jp9Egk7AgZFFo= Hello, I've got a kext, that contains several classes, say class A and class B. Instances of class B are clients of those of class A. They are loading just fine. B should be able to restrict kext unload. For this purpose I override B::terminate() which returns false if the kext shouldn't be unloaded. I expect that the whole chain A<-B<-B::userClient keeps on working in this case and kextunload returns an error. The problem is that when I unload the kext and a instance of A is being tried to be unloaded, I get the stack: #0 B::terminate (this=0xffffff800be73100, options=1048583) #1 0xffffff800051d6be in IOService::terminateClient (this=<value temporarily unavailable, due to optimizations>, client=0xffffff800be73100, options=1048583) at /SourceCache/xnu/xnu-1486.2.11/iokit/Kernel/IOService.cpp:2235 #2 0xffffff800051d648 in IOService::requestTerminate (this=0xffffff800be73100, provider=0x100007, options=1048583) at /SourceCache/xnu/xnu-1486.2.11/iokit/Kernel/IOService.cpp:1660 #3 0xffffff800052235e in IOService::terminatePhase1 (this=0xffffff800c037800, options=7) at /SourceCache/xnu/xnu-1486.2.11/iokit/Kernel/IOService.cpp:1727 #4 0xffffff80005224c4 in IOService::terminate (this=<value temporarily unavailable, due to optimizations>, options=<value temporarily unavailable, due to optimizations>) at /SourceCache/xnu/xnu-1486.2.11/iokit/Kernel/IOService.cpp:2246 #5 0xffffff800052ee3b in _terminateDrivers (matching=0xffffff800c106880) at /SourceCache/xnu/xnu-1486.2.11/iokit/Kernel/IOCatalogue.cpp:609 ... Here frame 4 relates to A instance termination. B::terminate() returns false, but IOService::requestTerminate does't check the result and proceeds B's instance termination. What is the right way to handle my requirements? Thanks in advance. _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-kernel mailing list (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Maxim Zhuravlev