mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	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>
This commit is contained in:
		
							parent
							
								
									cd77b8212d
								
							
						
					
					
						commit
						7ca0026495
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		| 
						 | 
					@ -169,6 +169,8 @@ struct audit_entry {
 | 
				
			||||||
	struct audit_rule rule;
 | 
						struct audit_rule rule;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					extern int audit_pid;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Check to see if two rules are identical.  It is called from
 | 
					/* Check to see if two rules are identical.  It is called from
 | 
				
			||||||
 * audit_del_rule during AUDIT_DEL. */
 | 
					 * audit_del_rule during AUDIT_DEL. */
 | 
				
			||||||
static int audit_compare_rule(struct audit_rule *a, struct audit_rule *b)
 | 
					static int audit_compare_rule(struct audit_rule *a, struct audit_rule *b)
 | 
				
			||||||
| 
						 | 
					@ -768,7 +770,7 @@ void audit_free(struct task_struct *tsk)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Check for system calls that do not go through the exit
 | 
						/* Check for system calls that do not go through the exit
 | 
				
			||||||
	 * function (e.g., exit_group), then free context block. */
 | 
						 * function (e.g., exit_group), then free context block. */
 | 
				
			||||||
	if (context->in_syscall && context->auditable)
 | 
						if (context->in_syscall && context->auditable && context->pid != audit_pid)
 | 
				
			||||||
		audit_log_exit(context);
 | 
							audit_log_exit(context);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	audit_free_context(context);
 | 
						audit_free_context(context);
 | 
				
			||||||
| 
						 | 
					@ -903,7 +905,7 @@ void audit_syscall_exit(struct task_struct *tsk, int valid, long return_code)
 | 
				
			||||||
	if (likely(!context))
 | 
						if (likely(!context))
 | 
				
			||||||
		return;
 | 
							return;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (context->in_syscall && context->auditable)
 | 
						if (context->in_syscall && context->auditable && context->pid != audit_pid)
 | 
				
			||||||
		audit_log_exit(context);
 | 
							audit_log_exit(context);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	context->in_syscall = 0;
 | 
						context->in_syscall = 0;
 | 
				
			||||||
| 
						 | 
					@ -1126,7 +1128,6 @@ void audit_signal_info(int sig, struct task_struct *t)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	extern pid_t audit_sig_pid;
 | 
						extern pid_t audit_sig_pid;
 | 
				
			||||||
	extern uid_t audit_sig_uid;
 | 
						extern uid_t audit_sig_uid;
 | 
				
			||||||
	extern int audit_pid;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (unlikely(audit_pid && t->pid == audit_pid)) {
 | 
						if (unlikely(audit_pid && t->pid == audit_pid)) {
 | 
				
			||||||
		if (sig == SIGTERM || sig == SIGHUP) {
 | 
							if (sig == SIGTERM || sig == SIGHUP) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue