Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 May 2006 08:23:11 GMT
From:      Robert Watson <rwatson@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 98193 for review
Message-ID:  <200605310823.k4V8NBMQ044485@repoman.freebsd.org>

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

Change 98193 by rwatson@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);



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