Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Feb 2006 23:40:06 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 90906 for review
Message-ID:  <200602012340.k11Ne6Y5011359@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=90906

Change 90906 by rwatson@rwatson_zoo on 2006/02/01 23:39:33

	For ABI reasons, move td_ar from the zero'd section of struct
	thread to the end, and add explicit zeroing.  This will allow
	audit support to be merged to RELENG_6 without changing the
	layout of existing fields in struct thread.

Affected files ...

.. //depot/projects/trustedbsd/audit3/sys/kern/kern_thread.c#5 edit
.. //depot/projects/trustedbsd/audit3/sys/security/audit/audit.c#3 edit
.. //depot/projects/trustedbsd/audit3/sys/security/audit/audit.h#7 edit
.. //depot/projects/trustedbsd/audit3/sys/sys/proc.h#11 edit

Differences ...

==== //depot/projects/trustedbsd/audit3/sys/kern/kern_thread.c#5 (text+ko) ====

@@ -43,6 +43,8 @@
 #include <sys/ktr.h>
 #include <sys/umtx.h>
 
+#include <security/audit/audit.h>
+
 #include <vm/vm.h>
 #include <vm/vm_extern.h>
 #include <vm/uma.h>
@@ -133,6 +135,10 @@
 	 * next thread.
 	 */
 	td->td_critnest = 1;
+
+#ifdef AUDIT
+	audit_thread_alloc(td);
+#endif
 	return (0);
 }
 

==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit.c#3 (text+ko) ====

@@ -1013,6 +1013,16 @@
 	//printf("audit_proc_alloc: pid %d p_au %p\n", p->p_pid, p->p_au);
 }
 
+/*
+ * Allocate storage for a new thread.
+ */
+void
+audit_thread_alloc(struct thread *td)
+{
+
+	td->td_ar = NULL;
+}
+
 /* 
  * Initialize the audit information for the a process, presumably the first 
  * process in the system.

==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit.h#7 (text+ko) ====

@@ -178,6 +178,7 @@
 void			 audit_proc_fork(struct proc *parent, 
 					 struct proc *child);
 void			 audit_proc_free(struct proc *p);
+void			 audit_thread_alloc(struct thread *td);
 
 /*
  * Define a macro to wrap the audit_arg_* calls by checking the global

==== //depot/projects/trustedbsd/audit3/sys/sys/proc.h#11 (text+ko) ====

@@ -296,7 +296,6 @@
 	u_long		td_profil_addr;	/* (k) Temporary addr until AST. */
 	u_int		td_profil_ticks; /* (k) Temporary ticks until AST. */
 	char		td_name[MAXCOMLEN + 1];	/* (*) Thread name. */
-	struct kaudit_record	*td_ar;	/* (k) Active audit record, if any. */
 #define	td_endzero td_base_pri
 
 /* Copied during fork1() or thread_sched_upcall(). */
@@ -329,6 +328,7 @@
 	volatile u_int	td_critnest;	/* (k*) Critical section nest level. */
 	struct mdthread td_md;		/* (k) Any machine-dependent fields. */
 	struct td_sched	*td_sched;	/* (*) Scheduler-specific data. */
+	struct kaudit_record	*td_ar;	/* (k) Active audit record, if any. */
 };
 
 /*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200602012340.k11Ne6Y5011359>