On Wed, Oct 24, 2001 at 07:20:27PM +0800, tongcd wrote: > Hello , > I write a loadable kernel and add a member to struct task_struct named > security. I alloc memory to every process p->security memory .when i > want to rmmod the module ,i use for_each_task(p ) to travel each > process and free the memory that i have already > alloc(p->security!=NULL), sometime it is ok,sometime system Oops,I > found that if freeing for current process it is ok,Is that true,How > can free the memory in that other process's task_struct in > cleanup_module( ) in a safer way. You might want to take a look at the LSM patch <http://lsm.immunix.org> that does just this. It also provides a framework for you to write your own security module without having to worry about placing your hooks into the kernel, as they are already provided. Hope this helps, greg k-h - Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ IRC Channel: irc.openprojects.net / #kernelnewbies Web Page: http://www.kernelnewbies.org/