• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
kernel panic
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

kernel panic


  • Subject: kernel panic
  • From: David A Rowland <email@hidden>
  • Date: Fri, 2 Jun 2006 10:43:29 -0700

Title: kernel panic
I have an application and a kernel extension that communicate. For reliability the app must determine whether the kext is present (loaded). I do it this way:

open a socket

        Sock = socket(PF_SYSTEM, SOCK_DGRAM, SYSPROTO_CONTROL);
       
if (Sock) {

send an ioctl query with the name of the kext

    if (ioctl(Sock, CTLIOCGINFO, &info))
    {


If that fails, the kext is not loaded and the application indicates that. If it succeeds I go ahead and open a connection

            int result = connect(Sock, (struct sockaddr *)&addr, sizeof(addr));
           
if (result == 0 || errno == EISCONN)
            {
               
return true;


and everything works.

I get a kernel panic under these circumstances:

1) run the app. It sees that the kext is absent and says so.
2) load the kext. The app sees that it is present and conducts its business.
3) unload the kext -- kernel panic

After tracing the operation, it seems that the ioctl reports the kext present even after it has been unloaded. That permits the code to try a setsockopt which kills the system.

Am I misusing the ioctl? Is there a bug or "feature" I have missed?

thanks,

David
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: kernel panic
      • From: Josh Graessley <email@hidden>
  • Prev by Date: Re: Crash Report
  • Next by Date: Re: kernel panic
  • Previous by thread: Re: Crash Report
  • Next by thread: Re: kernel panic
  • Index(es):
    • Date
    • Thread