Thread: tried to execute NX-protected page (linux kernel module development)

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    795

    tried to execute NX-protected page (linux kernel module development)

    I'm writing a PCI driver as an insertable module for my Linux (kernel 3.0), and it works up until it tries to call register_netdev. The structure that is trying to be registered is allocated and filled out correctly, and the request_regions, iomap, and enable_device are done first. Error checking returns that all of the above functions are performed correctly.

    There is no syntax errors present in the program, but it has an oops as follows:
    Code:
    kernel tried to execute NX-protected page - exploit attempt? (uid: 0)
    BUG: unable to handle kernel paging request at ffff88002c952c00
    IP: [<ffff88002c952c00>] 0xffff8802c952163
    This is odd, especially because neither the IP or RIP show a function name, only a hex address. How would I debug an oops that lacks function names and offsets? Google didn't turn out anything...

  2. #2
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Control was transferred to a data page. This could happen because of a stack overflow (overwrite return address with bogus pointer into data pages), or by calling a function pointer which isn't pointing where it's supposed to be pointing.

    Did the oops include a stack dump?
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  3. #3
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    Yes, should I post it here? (or is it too specific to be useful)

    Also, going to check for those types of errors now...

  4. #4
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    I wouldn't be able to make sense of an oops on your system without your kernel and ksyms.. There are various resources on the web for debugging oopses using ksymoops etc.
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  5. #5
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    Thanks, looking into those now.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linux kernel module help
    By Annonymous in forum Linux Programming
    Replies: 18
    Last Post: 05-01-2011, 10:59 PM
  2. Check for integer in kernel module
    By NuNn in forum C Programming
    Replies: 1
    Last Post: 04-13-2009, 11:27 AM
  3. linux kernel module programming
    By open_engg in forum Linux Programming
    Replies: 2
    Last Post: 08-05-2007, 04:41 PM
  4. linux kernel module programming
    By circuit in forum Linux Programming
    Replies: 10
    Last Post: 12-01-2004, 06:08 PM
  5. Kernel Module Programming in 2.6
    By KneeLess in forum Linux Programming
    Replies: 1
    Last Post: 04-13-2004, 11:51 AM