Debug the expected impossibility of the audit_backlog_queue reserve
being used up.

Signed-off-by: Richard Guy Briggs <[email protected]>
---
 kernel/audit.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/kernel/audit.c b/kernel/audit.c
index d6f4763..9e9c02b 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1527,6 +1527,12 @@ struct audit_buffer *audit_log_start(struct 
audit_context *ctx, gfp_t gfp_mask,
                        atomic_inc(&audit_overflows);
                        overflow_counted = 1;
                }
+               if (reserve) {
+                       pr_warn("( %lu %lu )"
+                               "  Qstuck apid=%d pid=%d comm=%s type=%d 
reserve=%d Qlen=%d\n",
+                               timeout_start, jiffies-timeout_start,
+                               audit_pid, current->pid, current->comm, type, 
reserve, skb_queue_len(&audit_skb_queue));
+               }
                if (gfp_mask & __GFP_WAIT && audit_backlog_wait_time) {
                        long sleep_time;
 
@@ -1534,6 +1540,12 @@ struct audit_buffer *audit_log_start(struct 
audit_context *ctx, gfp_t gfp_mask,
                                atomic_inc(&audit_waiters);
                                waiter = 1;
                        }
+                       if (reserve) {
+                               pr_warn("( %lu %lu )"
+                                       "   Qreallystuck apid=%d pid=%d comm=%s 
type=%d reserve=%d Qlen=%d\n",
+                                       timeout_start, jiffies-timeout_start,
+                                       audit_pid, current->pid, current->comm, 
type, reserve, skb_queue_len(&audit_skb_queue));
+                       }
                        sleep_time = timeout_start + audit_backlog_wait_time - 
jiffies;
                        if (sleep_time > 0) {
                                sleep_time = wait_for_auditd(sleep_time);
-- 
1.7.1

--
Linux-audit mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/linux-audit

Reply via email to