From: zhangxiliang <zhangxiliang@cn.fujitsu.com>
To: Steve Grubb <sgrubb@redhat.com>
Cc: Linux Audit <linux-audit@redhat.com>
Subject: Re: [PATCH 4/4] Add the checking of key field for a watch or syscall given
Date: Tue, 05 Aug 2008 14:47:26 +0800 [thread overview]
Message-ID: <4897F77E.5060903@cn.fujitsu.com> (raw)
In-Reply-To: <200808042159.00711.sgrubb@redhat.com>
Steve Grubb said the following on 2008-08-05 9:59:
>
> Right, but I don't see where it gets set to a 1.
>
Thank you for your suggestion.
I found the audit_permadded is set to 1 in audit_setup_perms() and setopt() after the AUDIT_PERM field.
But I think it is not enough.
When the watch is added and AUDIT_PERM is not added, the perm r,w,x,a should be added by kernel default.
So I think the audit_permadded should be set to 1 after a watch added.
I make a new patch for it. The "key" patch and new patch should use together.
Subject: [PATCH] When the watch is set, the audit_permadded should be set to 1
Signed-off-by: Zhang Xiliang <zhangxiliang@cn.fujitsu.com>
---
lib/libaudit.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/lib/libaudit.c b/lib/libaudit.c
index 71267de..9a317c5 100644
--- a/lib/libaudit.c
+++ b/lib/libaudit.c
@@ -580,6 +580,8 @@ int audit_add_watch_dir(int type, struct audit_rule_data **rulep,
rule->fieldflags[1] = AUDIT_EQUAL;
rule->values[1] = AUDIT_PERM_READ | AUDIT_PERM_WRITE |
AUDIT_PERM_EXEC | AUDIT_PERM_ATTR;
+
+ audit_permadded = 1;
return 0;
}
@@ -941,6 +943,10 @@ int audit_rule_fieldpair_data(struct audit_rule_data **rulep, const char *pair,
rule = *rulep;
}
strncpy(&rule->buf[offset], v, vlen);
+
+ if(flags && (AUDIT_WATCH || AUDIT_DIR))
+ audit_permadded = 1;
+
break;
case AUDIT_ARCH:
if (audit_syscalladded)
next prev parent reply other threads:[~2008-08-05 6:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-02 10:16 [PATCH 4/4] Add the checking of key field for a watch or syscall given zhangxiliang
2008-08-05 0:06 ` Steve Grubb
2008-08-05 0:36 ` zhangxiliang
2008-08-05 1:59 ` Steve Grubb
2008-08-05 6:47 ` zhangxiliang [this message]
2008-08-05 13:49 ` Steve Grubb
2008-08-05 13:44 ` 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=4897F77E.5060903@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