lkml.org 
[lkml]   [1999]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectintercepting syscalls (by setting pointer in sys_call_table)
not really useful, just playing around, but learned a lot through it...

what I do: change the entry for a syscall in sys_call_table to point
to my own funtion (which does a few printk() and then jumps to the
original pointer with the original arguments), using a module
(inserted: use my function, remove: re-insert original pointer into
sys_call_table).

question: is manipulating sys_call_table, changing the pointer, safe
(SMP)? not from a functional point of view, I know what I'm doing
(even if my system dies ;-) ), but is it SMP-safe? I read a little
arch/i386/entry.S, _very_ interesting, but doesn't help that much...
I'm asking because someone who tried the same on his SMP system
complained about a system crash when he unloaded the module, and the
only line of code for unload is

void cleanup_module(void)
{
sys_call_table[__NR_(whatever-syscall-I'm-experimenting with)]
= origsockcall;
}

and now I'm trying to find the reason, not for any real purpose, only
for the sake of knowing-why...

Thanks!
==
--
Michael Hasenstein
http://www.csn.tu-chemnitz.de/~mha/
Private Pilot (ASEL) since 1998
_________________________________________________________
DO YOU YAHOO!?
Get your free @yahoo.com address at http://mail.yahoo.com


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:50    [W:0.046 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site