From: zhangxiliang <zhangxiliang@cn.fujitsu.com>
To: sgrubb@redhat.com, Linux Audit <linux-audit@redhat.com>
Subject: [PATCH] In some platforms, "connect", "bind", "accept", "sendto", "recvfrom", "sendfile" arenot audit directly.
Date: Wed, 30 Jul 2008 16:29:55 +0800 [thread overview]
Message-ID: <48902683.6070902@cn.fujitsu.com> (raw)
Hello Steve,
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" isnot 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?
Signed-off-by: Zhang Xiliang <zhangxiliang@cn.fujitsu.com>
---
lib/deprecated.c | 7 +++++++
lib/libaudit.c | 6 ++++++
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/lib/deprecated.c b/lib/deprecated.c
index 4f0c14e..ced4c62 100644
--- a/lib/deprecated.c
+++ b/lib/deprecated.c
@@ -160,6 +160,13 @@ int audit_rule_syscallbyname(struct audit_rule *rule,
if (nr < 0) {
if (isdigit(scall[0]))
nr = strtol(scall, NULL, 0);
+ if(strcmp(scall, "connect") || strcmp(scall, "bind")
+ || strcmp(scall, "accept") || strcmp(scall, "sendto")
+ || strcmp(scall, "recvfrom") || strcmp(scall, "sendfile")) {
+ scall = "socketcall";
+ nr = audit_name_to_syscall(scall, machine);
+ }
+
}
if (nr >= 0)
return audit_rule_syscall(rule, nr);
diff --git a/lib/libaudit.c b/lib/libaudit.c
index 0588537..36baff1 100644
--- a/lib/libaudit.c
+++ b/lib/libaudit.c
@@ -761,6 +761,12 @@ int audit_rule_syscallbyname_data(struct audit_rule_data *rule,
if (nr < 0) {
if (isdigit(scall[0]))
nr = strtol(scall, NULL, 0);
+ if(strcmp(scall, "connect") || strcmp(scall, "bind")
+ || strcmp(scall, "accept") || strcmp(scall, "sendto")
+ || strcmp(scall, "recvfrom") || strcmp(scall, "sendfile")) {
+ scall = "socketcall";
+ nr = audit_name_to_syscall(scall, machine);
+ }
}
if (nr >= 0)
return audit_rule_syscall_data(rule, nr);
--
1.5.4.2
--
Regards
Zhang Xiliang
next reply other threads:[~2008-07-30 8:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-30 8:29 zhangxiliang [this message]
2008-07-30 11:58 ` [PATCH] In some platforms, "connect", "bind", "accept", "sendto", "recvfrom", "sendfile" arenot audit directly Steve Grubb
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=48902683.6070902@cn.fujitsu.com \
--to=zhangxiliang@cn.fujitsu.com \
--cc=linux-audit@redhat.com \
--cc=sgrubb@redhat.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