From owner-p4-projects@FreeBSD.ORG Sat Feb 4 12:53: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 542D616A425; Sat, 4 Feb 2006 12:53: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 D851216A422 for ; Sat, 4 Feb 2006 12:53: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 A3B2743D5F for ; Sat, 4 Feb 2006 12:53:40 +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 k14CreTx011089 for ; Sat, 4 Feb 2006 12:53:40 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 k14Crecf011086 for perforce@freebsd.org; Sat, 4 Feb 2006 12:53:40 GMT (envelope-from bb+lists.freebsd.perforce@cyrus.watson.org) Date: Sat, 4 Feb 2006 12:53:40 GMT Message-Id: <200602041253.k14Crecf011086@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 91049 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: Sat, 04 Feb 2006 12:53:43 -0000 http://perforce.freebsd.org/chv.cgi?CH=91049 Change 91049 by rwatson@rwatson_peppercorn on 2006/02/04 12:53:12 When GC'ing a thread, assert that it has no active audit record. This should not happen, but with this assert, brueffer and I would not have spent 45 minutes trying to figure out why he wasn't seeing audit records with the audit version in CVS. Affected files ... .. //depot/projects/trustedbsd/audit3/sys/kern/kern_thread.c#6 edit .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit.c#5 edit .. //depot/projects/trustedbsd/audit3/sys/security/audit/audit.h#10 edit Differences ... ==== //depot/projects/trustedbsd/audit3/sys/kern/kern_thread.c#6 (text+ko) ==== @@ -172,7 +172,9 @@ /* NOTREACHED */ } #endif - +#ifdef AUDIT + audit_thread_free(td); +#endif free_unr(tid_unrhdr, td->td_tid); sched_newthread(td); } ==== //depot/projects/trustedbsd/audit3/sys/security/audit/audit.c#5 (text+ko) ==== @@ -1026,6 +1026,16 @@ td->td_ar = NULL; } +/* + * Thread destruction. + */ +void +audit_thread_free(struct thread *td) +{ + + KASSERT(td->td_ar == NULL, ("audit_thread_free: 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#10 (text+ko) ==== @@ -182,6 +182,7 @@ struct proc *child); void audit_proc_free(struct proc *p); void audit_thread_alloc(struct thread *td); +void audit_thread_free(struct thread *td); /* * Define a macro to wrap the audit_arg_* calls by checking the global