mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: selvakumar nagendran <kernelselva@yahoo.com>
To: linux-kernel@vger.kernel.org
Subject: Completing syscall operations on module exit
Date: Thu, 6 Jan 2005 01:28:54 -0800 (PST)	[thread overview]
Message-ID: <20050106092854.32803.qmail@web60604.mail.yahoo.com> (raw)

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 

                 reply	other threads:[~2005-01-06  9:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050106092854.32803.qmail@web60604.mail.yahoo.com \
    --to=kernelselva@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®