aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@shinybook.infradead.org>2005-05-19 06:23:13 -0400
committerDavid Woodhouse <dwmw2@shinybook.infradead.org>2005-05-19 06:23:13 -0400
commit7ca0026495dbb644b4e32ede76be44072cb2bc7a (patch)
tree12c832161ebb98a7e7aec7edd8942e20809fafec
parentcd77b8212d5473b800ac865364981d334ff564ea (diff)
AUDIT: Quis Custodiet Ipsos Custodes?
Nobody does. Really, it gets very silly if auditd is recording its own actions. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
-rw-r--r--kernel/auditsc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/auditsc.c b/kernel/auditsc.c
index 818778d5b6ad..78d7a13fc86f 100644
--- a/kernel/auditsc.c
+++ b/kernel/auditsc.c
@@ -169,6 +169,8 @@ struct audit_entry {
169 struct audit_rule rule; 169 struct audit_rule rule;
170}; 170};
171 171
172extern int audit_pid;
173
172/* Check to see if two rules are identical. It is called from 174/* Check to see if two rules are identical. It is called from
173 * audit_del_rule during AUDIT_DEL. */ 175 * audit_del_rule during AUDIT_DEL. */
174static int audit_compare_rule(struct audit_rule *a, struct audit_rule *b) 176static int audit_compare_rule(struct audit_rule *a, struct audit_rule *b)
@@ -768,7 +770,7 @@ void audit_free(struct task_struct *tsk)
768 770
769 /* Check for system calls that do not go through the exit 771 /* Check for system calls that do not go through the exit
770 * function (e.g., exit_group), then free context block. */ 772 * function (e.g., exit_group), then free context block. */
771 if (context->in_syscall && context->auditable) 773 if (context->in_syscall && context->auditable && context->pid != audit_pid)
772 audit_log_exit(context); 774 audit_log_exit(context);
773 775
774 audit_free_context(context); 776 audit_free_context(context);
@@ -903,7 +905,7 @@ void audit_syscall_exit(struct task_struct *tsk, int valid, long return_code)
903 if (likely(!context)) 905 if (likely(!context))
904 return; 906 return;
905 907
906 if (context->in_syscall && context->auditable) 908 if (context->in_syscall && context->auditable && context->pid != audit_pid)
907 audit_log_exit(context); 909 audit_log_exit(context);
908 910
909 context->in_syscall = 0; 911 context->in_syscall = 0;
@@ -1126,7 +1128,6 @@ void audit_signal_info(int sig, struct task_struct *t)
1126{ 1128{
1127 extern pid_t audit_sig_pid; 1129 extern pid_t audit_sig_pid;
1128 extern uid_t audit_sig_uid; 1130 extern uid_t audit_sig_uid;
1129 extern int audit_pid;
1130 1131
1131 if (unlikely(audit_pid && t->pid == audit_pid)) { 1132 if (unlikely(audit_pid && t->pid == audit_pid)) {
1132 if (sig == SIGTERM || sig == SIGHUP) { 1133 if (sig == SIGTERM || sig == SIGHUP) {