linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Completing syscall operations on module exit
@ 2005-01-06  9:28 selvakumar nagendran
  0 siblings, 0 replies; only message in thread
From: selvakumar nagendran @ 2005-01-06  9:28 UTC (permalink / raw)
  To: linux-kernel

Hello kernelexperts,
  I am intercepting system calls in kernel 2.4.28. I
have implemented it as a kernel module. In my pipe
syscall implementation, I am storing the file
descriptors created in a linked list structure using
kernel linked list interface. (<linux/list.h>) and I
am printing the list in the exit module portion.
  Now, It stores all descriptors created in the linked
list. While unloading, my module will restore the
original syscall pointer. 
   But if I rmmod the module, the last entry is
missing. It is not added into the list. What could be
the problem?
I think while my syscall is executing, rmmod stops it
and redirects it to the original sycall. How can I
rewrite my exit module to ensure that it will also
record the last descriptor created?

Regards,
selva

void __exit exit_sched(void)
{
	extern long sys_call_table[];
	//struct my_process *temp = NULL, *freetemp = NULL;
	struct my_process *my;
	struct list_head *p;

	/* better put back the real sys call !*/
	sys_call_table[__NR_pipe] = (unsigned
long)sys_pipe_saved;
	sys_call_table[__NR_close] = (unsigned long)
sys_close_saved;
	printk("\n Writing Pipe Access Details for every
process..");
	printk("\n ProcessID,ReadEnd,WriteEnd");

	list_for_each(p,&proinit.list)	{
		my = list_entry(p, struct my_process, list);
		printk("\n%ld,", my -> pid);
		printk("%d,",  my -> pipe_read_end);
		printk("%d",  my -> pipe_write_end);
	}

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-01-06  9:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-06  9:28 Completing syscall operations on module exit selvakumar nagendran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).