Re: execve replacement.

2000-10-04 Thread David Wagner
Abel Muñoz Alcaraz wrote: > I have replaced the execve() kernel [syscall] > with my own implementation but it doesn't work well. In Linux, hooking into sys_call_table[] is a pretty painful way to interpose on system calls. Unfortunately, there's no other way to do it (in Linux) that I know of..

Re: execve replacement.

2000-10-04 Thread Daniel Phillips
John Levon wrote: > > On Wed, 4 Oct 2000, [iso-8859-1] Abel Muñoz Alcaraz wrote: > > > I need that somebody says to my module when a user application has started > > or finished, and what is its name and pid. > > > you do not need to trace system calls then. Provide a misc char device, > and get

RE: execve replacement.

2000-10-04 Thread Tigran Aivazian
d cleanup_module() > { > if (sys_call_table[__NR_execve] != my_execve) > { > printk(KERN_INFO "\nThe system has been left in a unpredictable > state.\nPlease, reboot it.\n"); > } > > sys_call_table[__NR_exit] = system_exit; >

Re: execve replacement.

2000-10-04 Thread John Levon
On Wed, 4 Oct 2000, Brian Gerst wrote: > John Levon wrote: > > anyway, you can just put refcounts in your hijacked system calls; that is > > the safe way to do it, and doesn't require any kernel patches, just extra > > cost in the intercepted system calls. > > > > e.g. : > > > > my_syswhatever(

RE: execve replacement.

2000-10-04 Thread John Levon
On Wed, 4 Oct 2000, [iso-8859-1] Abel Muñoz Alcaraz wrote: > I need that somebody says to my module when a user application has started > or finished, and what is its name and pid. > you do not need to trace system calls then. Provide a misc char device, and get the user app to open it. Then yo

Re: execve replacement.

2000-10-04 Thread Brian Gerst
John Levon wrote: > anyway, you can just put refcounts in your hijacked system calls; that is > the safe way to do it, and doesn't require any kernel patches, just extra > cost in the intercepted system calls. > > e.g. : > > my_syswhatever(...) > { > MOD_INC_USE_COUNT; > original

RE: execve replacement.

2000-10-04 Thread Abel Muñoz Alcaraz
exit] = system_exit; sys_call_table[__NR_kill] = system_kill; sys_call_table[__NR_execve] = system_execve; } If you know a better way, please say me. -Abel. -Original Message- From: John Levon [mailto:[EMAIL PROTECTED]] Sent: miércoles, 04 de octubre de 2000 16:21 To: Abel Muñoz Alc

Re: execve replacement.

2000-10-04 Thread John Levon
On Wed, 4 Oct 2000, Brian Gerst wrote: > Even your overloader has a small module unload race. The only 100% > race-free way is to put module usage counting into the core kernel, like > the VFS changes with ->open that were done in 2.3.x. This would mean > added overhead for all syscalls, so man

Re: execve replacement.

2000-10-04 Thread Brian Gerst
John Levon wrote: > > On Wed, 4 Oct 2000, Brian Gerst wrote: > > > "it doesn't work well" is a bit vague... > > > > I am guessing that you are getting an unresolved symbol. Modifying the > > system call table is not and probably never will be available for > > modules. The syscall table is ver

Re: execve replacement.

2000-10-04 Thread John Levon
On Wed, 4 Oct 2000, Brian Gerst wrote: > "it doesn't work well" is a bit vague... > > I am guessing that you are getting an unresolved symbol. Modifying the > system call table is not and probably never will be available for > modules. The syscall table is very architecture dependant, and is n

Re: execve replacement.

2000-10-04 Thread John Levon
On Wed, 4 Oct 2000, [iso-8859-1] Abel Muñoz Alcaraz wrote: > Hi everybody, > > I have replaced the execve() kernel API with my own implementation but it > doesn't work well. > > extern void * sys_call_table[] > > asmlinkage int (*system_execve)(const char *, c

Re: execve replacement.

2000-10-04 Thread Brian Gerst
Abel Muñoz Alcaraz wrote: > > Hi everybody, > > I have replaced the execve() kernel API with my own implementation but it > doesn't work well. "it doesn't work well" is a bit vague... I am guessing that you are getting an unresolved symbol. Modifying the system call table is not and p