From owner-p4-projects@FreeBSD.ORG Wed Feb 1 23:40:42 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 26A2B16A431; Wed, 1 Feb 2006 23:40:42 +0000 (GMT) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D10AA16A42F for ; Wed, 1 Feb 2006 23:40:41 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CEF1843DC3 for ; Wed, 1 Feb 2006 23:40:08 +0000 (GMT) (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k11Ne6qE011362 for ; Wed, 1 Feb 2006 23:40:06 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k11Ne6Y5011359 for perforce@freebsd.org; Wed, 1 Feb 2006 23:40:06 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Wed, 1 Feb 2006 23:40:06 GMT Message-Id: <200602012340.k11Ne6Y5011359@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to bb+lists.freebsd.perforce@cyrus.watson.org using -f From: Robert Watson To: Perforce Change Reviews Cc: Subject: PERFORCE change 90906 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2006 23:40:42 -0000 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 #include +#include + #include #include #include @@ -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. */ }; /*