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

using devinet_ioctl from a kernel module



Hello all,

I'm experiencing a kernel panic in RedHat Linux 8.0 with 2.4.20 kernel 
when calling the function devinet_ioctl() with the SIOCSIFADDR command 
from within a kernel module.  The function is called within the scope of
userspace addressing in the following manner.

int res;
mm_segment_t oldfs = get_fs();
set_fs(get_ds());
res = devinet_ioctl(cmd,arg);
set_fs(oldfs);

This is how ipconfig.c illustrates how to use this function from within 
a kernel module, see ic_dev_ioctl() function in the source file.

When running in the scope of a kgdb patched kernel, I see the kernel 
panic when this function is called from within my kernel module. The 
panic happens because alloc_skb is being called non-atomically from an 
interrupt.

Is there anything grossly wrong that I am doing? Am I supposed to do 
something else before calling this function?

Thanks,
Vishwas.

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/