Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178105417
D50879.1795976295.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D50879.1795976295.diff
View Options
diff --git a/sys/security/audit/audit.c b/sys/security/audit/audit.c
--- a/sys/security/audit/audit.c
+++ b/sys/security/audit/audit.c
@@ -411,15 +411,22 @@
return (curthread->td_ar);
}
-/*
- * XXXAUDIT: Shouldn't there be logic here to sleep waiting on available
- * pre_q space, suspending the system call until there is room?
- */
struct kaudit_record *
audit_new(int event, struct thread *td)
{
struct kaudit_record *ar;
+ mtx_lock(&audit_mtx);
+ audit_pre_q_len++;
+
+ /*
+ * Constrain the number of committed audit records based on
+ * the configurable parameter.
+ */
+ while (audit_q_len >= audit_qctrl.aq_hiwater)
+ cv_wait(&audit_watermark_cv, &audit_mtx);
+ mtx_unlock(&audit_mtx);
+
/*
* Note: the number of outstanding uncommitted audit records is
* limited to the number of concurrent threads servicing system calls
@@ -427,11 +434,6 @@
*/
ar = uma_zalloc_arg(audit_record_zone, td, M_WAITOK);
ar->k_ar.ar_event = event;
-
- mtx_lock(&audit_mtx);
- audit_pre_q_len++;
- mtx_unlock(&audit_mtx);
-
return (ar);
}
@@ -565,13 +567,6 @@
return;
}
- /*
- * Constrain the number of committed audit records based on the
- * configurable parameter.
- */
- while (audit_q_len >= audit_qctrl.aq_hiwater)
- cv_wait(&audit_watermark_cv, &audit_mtx);
-
TAILQ_INSERT_TAIL(&audit_q, ar, k_q);
audit_q_len++;
audit_pre_q_len--;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 29, 6:18 PM (8 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42094116
Default Alt Text
D50879.1795976295.diff (1 KB)
Attached To
Mode
D50879: audit: move the wait from the queue length from the commit to alloc
Attached
Detach File
Event Timeline