Re: How to hook the system call?

2011-11-28 Thread Jonathan Neuschäfer
On Mon, Nov 28, 2011 at 02:12:37AM +0100, richard -rw- weinberger wrote: Please keep in mind that hooking a system call is very bad and error prone. Sure. -- Jonathan Neuschäfer ___ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org

Re: How to hook the system call?

2011-11-27 Thread Jonathan Neuschäfer
On Wed, Nov 23, 2011 at 04:40:14PM +0800, Geraint Yang wrote: Hello everyone, I am going to hook a system call like 'read' or 'send' by modifying the sys_call_table, but it seems that the sys_call_table is in read only page, how can I set modify the sys_call_table ? Or if there any method

Re: How to hook the system call?

2011-11-27 Thread richard -rw- weinberger
On Sun, Nov 27, 2011 at 11:17 PM, Jonathan Neuschäfer j.neuschae...@gmx.net wrote: On Wed, Nov 23, 2011 at 04:40:14PM +0800, Geraint Yang wrote: Hello everyone, I am going to hook a system call like 'read' or 'send' by modifying the sys_call_table, but it seems that the sys_call_table is in

Re: How to hook the system call?

2011-11-27 Thread Geraint Yang
Thanks for advice ! I am using the LSM framework even though it need recompiling the kernel. But I will also give a try to the kernelroll module. Modifying sys_call_table is easier to get error but it can get more freedom than LSM framework which could only hook on limit hooking points. On Mon,

How to hook the system call?

2011-11-23 Thread Geraint Yang
Hello everyone, I am going to hook a system call like 'read' or 'send' by modifying the sys_call_table, but it seems that the sys_call_table is in read only page, how can I set modify the sys_call_table ? Or if there any method that I can use to hook a system call in module without modify the

Re: How to hook the system call?

2011-11-23 Thread Alexandru Juncu
On Wed, Nov 23, 2011 at 10:40 AM, Geraint Yang geraint0...@gmail.com wrote: Hello everyone, I am going to hook a system call like 'read' or 'send' by modifying the sys_call_table, but it seems that the sys_call_table is in read only page, how can I set modify the sys_call_table ? Or if there

Re: How to hook the system call?

2011-11-23 Thread Daniel Baluta
On Wed, Nov 23, 2011 at 11:22 AM, Alexandru Juncu alex.ju...@rosedu.org wrote: On Wed, Nov 23, 2011 at 10:40 AM, Geraint Yang geraint0...@gmail.com wrote: Hello everyone, I am going to hook a system call like 'read' or 'send' by modifying the sys_call_table, but it seems that the

Re: How to hook the system call?

2011-11-23 Thread Alexandru Juncu
On Wed, Nov 23, 2011 at 12:10 PM, Daniel Baluta daniel.bal...@gmail.com wrote: On Wed, Nov 23, 2011 at 11:22 AM, Alexandru Juncu alex.ju...@rosedu.org wrote: On Wed, Nov 23, 2011 at 10:40 AM, Geraint Yang geraint0...@gmail.com wrote: Hello everyone, I am going to hook a system call like

Re: How to hook the system call?

2011-11-23 Thread rohan puri
On Wed, Nov 23, 2011 at 3:57 PM, Alexandru Juncu alex.ju...@rosedu.orgwrote: On Wed, Nov 23, 2011 at 12:10 PM, Daniel Baluta daniel.bal...@gmail.com wrote: On Wed, Nov 23, 2011 at 11:22 AM, Alexandru Juncu alex.ju...@rosedu.org wrote: On Wed, Nov 23, 2011 at 10:40 AM, Geraint Yang

Re: How to hook the system call?

2011-11-23 Thread Geraint Yang
Hi, Thank all of you for helping me with problem! I don't want to modify my kernel source so I am trying to learn to use LSM security hook even though it seems that it couldn't hook all the system calls, I think it should be enough for me. Thanks again! On Wed, Nov 23, 2011 at 8:02 PM, rohan

Re: How to hook the system call?

2011-11-23 Thread Alexandru Juncu
On Wed, Nov 23, 2011 at 6:50 PM, Geraint Yang geraint0...@gmail.com wrote: Hi, Thank all of you for helping me with problem! I don't want to modify my kernel source so I am trying to learn to use LSM security hook even though it seems that it couldn't hook all the system calls, I think it

Re: How to hook the system call?

2011-11-23 Thread Geraint Yang
Hi, I have tried the LSM framework,but when I make my module , I got waining:'register_security' undefined, then I check security/security.c and found out that register_security is not exported ! So if I want to use this function ,I must hack kernel by exporting and recompiling kernel which is

Re: How to hook the system call?

2011-11-23 Thread Nuno Martins
On Wed, Nov 23, 2011 at 6:05 PM, Geraint Yang geraint0...@gmail.com wrote: Hi, I have tried the LSM framework,but when I make my module , I got waining:'register_security' undefined, then I check security/security.c and found out that register_security is not exported ! So if I want to use

Re: How to hook the system call?

2011-11-23 Thread rohan puri
On Wed, Nov 23, 2011 at 11:35 PM, Geraint Yang geraint0...@gmail.comwrote: Hi, I have tried the LSM framework,but when I make my module , I got waining:'register_security' undefined, then I check security/security.c and found out that register_security is not exported ! So if I want to use