public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Eric Paris <eparis@redhat.com>
To: Wahaj Ali <wahajali@gmail.com>
Cc: Linux-audit@redhat.com
Subject: Re: Exec call auditing
Date: Mon, 10 May 2010 11:28:42 -0400	[thread overview]
Message-ID: <1273505322.2785.16.camel@localhost> (raw)
In-Reply-To: <n2q8f0355e81005061104h13018e00g9a4fe7e3b2299aa1@mail.gmail.com>

On Thu, 2010-05-06 at 23:04 +0500, Wahaj Ali wrote:
> Hello,
> 
> As part of my course I am required to look at the auditing code in the
> linux kernel, more specifically the part where the exec() calls are
> being logged. I would really appreciate any help, especially regarding
> where exactly that code in the whole database can be found, i.e. the
> part of the code that is logging the environment variables. My guess
> so far is that audit_log_single_execve_arg in auditsc.c is doing most
> part of the work.

a) I didn't think we logged the environment I thought we only logged the
execve arguments.  Maybe I'm wrong, it's been quite a while since I
rewrote a bunch of that stuff.

b) I feel like I'm doing your homework for you, but...

Actual logging is done in audit_log_exit().  This is run near syscall
exit and we print information that was collected during the syscall.  In
this case audit_log_exit() is going to call audit_execve_info() which
will call audit_log_single_execve_arg() for each argument in the list.
audit_log_single_execve_arg() takes care of making sure there is space
in the ab, creating new audit buffers if not and stuff like that.

The collection of that information is done back at the beginning of the
execve syscall entry in audit_bprm()   [it is actually called from
fs/exec.c::search_binary_handler().  I'll let you use grep to go farther
up in the tree to see how to get back to sys_execve()]  In audit_bprm()
you will see that we create and auxilary audit data struct to hold the
execve argument information pointer and attach it to the audit_context
so that we can find that information in audit_log_exit() later.

-Eric

      reply	other threads:[~2010-05-10 15:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-06 18:04 Exec call auditing Wahaj Ali
2010-05-10 15:28 ` Eric Paris [this message]

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=1273505322.2785.16.camel@localhost \
    --to=eparis@redhat.com \
    --cc=Linux-audit@redhat.com \
    --cc=wahajali@gmail.com \
    /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