OT: kernel oops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi again,

 

After browsing some of both Linux Device Drivers and Linux Kernel Development, I modified my kernel module code and now I get a kernel oops.

 

I am trying to hook the sys_write() system call based on some code from my professor.

 

The section of code that is having problems looks like this:

 

Char *tbuf = NULL;

tbuf = kmalloc(count, GFP_ATOMIC); // count is passed in from userspace

if (!tbuf)

                return -ENOMEM;

if (copy_from_user(&tbuf, buf, count))

return -EFAULT;

printk(KERN_INFO "Copy_from_user succeeded."\n");

kfree(tbuf);

 

I get a segmentation fault immediately after it prints copy_from_user succeeded into the log.

 

Oops message:

Oops: 0000 [#9] SMP

 

And as far as I can tell it is pointing to the kfree function at offset 0xba of 0xc0.

 

If there is a better place to post this (say a Linux developers list), I am happy to take my questions there, but this list is my first port of call for errors with Linux.

-- 
Best Regards, Donald

HYPERLINK "http://www.oracle.com/"; \nOracle
Donald raikes | Accessibility Specialist/ QA Engineer
Phone: HYPERLINK "tel:+15202717608"+15202717608 | Mobile: HYPERLINK "tel:+15202717608"+15202717608 
Oracle Quality Assurance
| Tucson, Arizona 

HYPERLINK "http://www.oracle.com/commitment"; \nGreen Oracle

Oracle is committed to developing practices and products that help protect the environment

 


[Index of Archives]     [Linux for the Blind]     [Fedora Discussioin]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]
  Powered by Linux