public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
From: Steve Grubb <sgrubb@redhat.com>
To: zhangxiliang <zhangxiliang@cn.fujitsu.com>
Cc: Linux Audit <linux-audit@redhat.com>
Subject: Re: [PATCH] In some platforms, "connect", "bind", "accept", "sendto", "recvfrom", "sendfile" arenot audit directly.
Date: Wed, 30 Jul 2008 07:58:45 -0400	[thread overview]
Message-ID: <200807300758.46328.sgrubb@redhat.com> (raw)
In-Reply-To: <48902683.6070902@cn.fujitsu.com>

On Wednesday 30 July 2008 04:29:55 zhangxiliang wrote:
>  When I use "autrace -r" or "auditctl -a exit,always -S connect" on "ia32"
> machine, it report some error. I found in some platforms, "connect",
> "bind", "accept", "sendto", "recvfrom", "sendfile" is not supported to call
> directly. They are used by syscall "socketcall".
>
>  I think when the socket calls are supported, we should insert "socketcall"
> instead of them. Do you agree with me?

Yes, I do. I have that listed in the TODO file at line 45. Getting this 
working would be a big help. However, there is one piece missing. Its not 
sufficient to just switch over to socketcall, you also have to tell it via 
the a0 field which socketcall represents the correct one. There are about 15 
syscalls that are multiplexed through socketcall with each one being a 
different a0 parameter.

For example, maybe we want to audit the connect syscall. If we look 
at /usr/include/linux/net.h, you find 

#define SYS_CONNECT     3               /* sys_connect(2)               */

Therefore the audit rule would be:

auditctl -a always,exit -S socketcall -F a0=3

So, we would need the patch to set the a0 field. That lookup table probably 
belongs in lib/lookup_table.c. There is a number to text converter in 
src/ausearch-lookup.c which might need to be moved. on the other hand, it 
might be simpler to just call the socketcall_lookup in src/ausearch-lookup.c 
and iterate through it by number until the text matches. That is not terribly 
efficient, but auditctl is not used very often and is not required to be 
fast. Either way is fine with me.

Also, we have the same problem that you identified with ipccall. Its defined 
numbers are in /usr/include/linux/ipc.h.

Thanks,
-Steve

      reply	other threads:[~2008-07-30 11:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-30  8:29 [PATCH] In some platforms, "connect", "bind", "accept", "sendto", "recvfrom", "sendfile" arenot audit directly zhangxiliang
2008-07-30 11:58 ` Steve Grubb [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=200807300758.46328.sgrubb@redhat.com \
    --to=sgrubb@redhat.com \
    --cc=linux-audit@redhat.com \
    --cc=zhangxiliang@cn.fujitsu.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