PERFORCE change 98193 for review

Robert Watson rwatson at FreeBSD.org
Wed May 31 01:24:34 PDT 2006


http://perforce.freebsd.org/chv.cgi?CH=98193

Change 98193 by rwatson at rwatson_zoo on 2006/05/31 08:23:09

	Create audit_pipe_preselect_flush() from
	audit_pipe_preselect_flush_locked(), as we call the preselect
	flush routine both with and without the audit pipe mutex; with
	when closing the pipe, and without when the flush ioctl is
	called.

Affected files ...

.. //depot/projects/trustedbsd/audit3/sys/security/audit/audit_pipe.c#24 edit

Differences ...

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

@@ -295,15 +295,24 @@
  * Delete all per-auid masks on an audit pipe.
  */
 static void
-audit_pipe_preselect_flush(struct audit_pipe *ap)
+audit_pipe_preselect_flush_locked(struct audit_pipe *ap)
 {
 	struct audit_pipe_preselect *app;
 
-	mtx_lock(&audit_pipe_mtx);
+	mtx_assert(&audit_pipe_mtx, MA_OWNED);
+
 	while ((app = TAILQ_FIRST(&ap->ap_preselect_list)) != NULL) {
 		TAILQ_REMOVE(&ap->ap_preselect_list, app, app_list);
 		free(app, M_AUDIT_PIPE_PRESELECT);
 	}
+}
+
+static void
+audit_pipe_preselect_flush(struct audit_pipe *ap)
+{
+
+	mtx_lock(&audit_pipe_mtx);
+	audit_pipe_preselect_flush_locked(ap);
 	mtx_unlock(&audit_pipe_mtx);
 }
 
@@ -561,7 +570,7 @@
 
 	mtx_assert(&audit_pipe_mtx, MA_OWNED);
 
-	audit_pipe_preselect_flush(ap);
+	audit_pipe_preselect_flush_locked(ap);
 	audit_pipe_flush(ap);
 	TAILQ_REMOVE(&audit_pipe_list, ap, ap_list);
 	free(ap, M_AUDIT_PIPE);


More information about the p4-projects mailing list