From: ravikumar.vallabhu@gmail.com (V.Ravikumar)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Hooking a system call.
Date: Wed, 28 Mar 2012 09:16:34 +0530 [thread overview]
Message-ID: <CA+CftcHAg2Ay7q0JYUwDtkmiA_DOCPL7g3rX2+e_rPJGbuoNxw@mail.gmail.com> (raw)
In-Reply-To: <CAGdaadaJerz7PgXt-tzJmpPoK6MdefQVRXxzPyYV_2Q=ffmQ8Q@mail.gmail.com>
On Mon, Mar 26, 2012 at 1:18 PM, Mulyadi Santosa
<mulyadi.santosa@gmail.com>wrote:
> Hi...
>
> On Mon, Mar 26, 2012 at 11:45, V.Ravikumar <ravikumar.vallabhu@gmail.com>
> wrote:
> > As part of auditing purpose I need to intercept/hook open/read/write
> system
> > calls.
> >
> > As I was lack of knowledge into kernel development.Could somebody help me
> > out here ?
> > I'm working on RHEL-5 machine with Linux kernel version 2.6.18
> > Thanks & Regards,
> > Ravi
>
> IMHO you better use SystemTap, which is based on Kprobes. It can be
> used to hook into almost every part of kernel system, with very less
> overhead.
>
>
Yes SystemTap is one of the elegant way to hook system calls.
But I need one help while hooking write system call. I need to print the
file name also, but file name is not passed to write system call. How can I
get the file for write (or sys_write ) system call.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120328/e4ed1874/attachment.html
next prev parent reply other threads:[~2012-03-28 3:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-26 4:45 Hooking a system call V.Ravikumar
2012-03-26 7:48 ` Mulyadi Santosa
2012-03-26 8:14 ` V.Ravikumar
2012-03-26 8:27 ` Mulyadi Santosa
2012-03-26 13:04 ` Peter Senna Tschudin
2012-03-26 13:43 ` Javier Martinez Canillas
2012-03-26 15:30 ` Ravishankar
2012-03-26 19:33 ` richard -rw- weinberger
2012-03-26 20:22 ` Fredrick
2012-03-28 3:46 ` V.Ravikumar [this message]
2012-03-28 6:10 ` rohan puri
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=CA+CftcHAg2Ay7q0JYUwDtkmiA_DOCPL7g3rX2+e_rPJGbuoNxw@mail.gmail.com \
--to=ravikumar.vallabhu@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).