Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752369AbdDINOT (ORCPT ); Sun, 9 Apr 2017 09:14:19 -0400 Received: from mail-ua0-f174.google.com ([209.85.217.174]:33337 "EHLO mail-ua0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752087AbdDINOO (ORCPT ); Sun, 9 Apr 2017 09:14:14 -0400 MIME-Version: 1.0 X-Originating-IP: [108.49.102.27] In-Reply-To: <20170409030220.GA33027@ubuntu-hedt> References: <20170409030220.GA33027@ubuntu-hedt> From: Paul Moore Date: Sun, 9 Apr 2017 09:14:03 -0400 Message-ID: Subject: Re: audit regressions in 4.11 To: Seth Forshee Cc: Eric Paris , linux-audit@redhat.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1550 Lines: 33 On Sat, Apr 8, 2017 at 11:02 PM, Seth Forshee wrote: > I've observed audit regressions in 4.11-rc when not using a userspace > audit daemon. The most obvious issue is that audit messages are not > appearing in dmesg anymore. If a sufficient number of audit messages are > generated the kernel will also start invoking the OOM killer. > > It looks like previously, when there's no auditd in userspace kauditd > would call kauditd_hold_skb(), which prints the message using printk and > either frees the skb or queues it (with a limit on the number of queued > skb's by default). > > Since 5b52330bbfe6 "audit: fix auditd/kernel connection state tracking" > when there's no auditd kauditd will instead use the retry queue, which > has no limit. But it will not process the retry queue when there's no > auditd, so messages pile up there indefinitely. Hi Seth, Thanks for the report. Let me play with this and think on it for a bit, but looking at the code again I think the issue is that we check to see if auditd is connected at the top of the kauditd_thread() loop and if it isn't we skip right to the main_queue label and bypass the hold/retry queue processing which has the logic to ensure the retry queue is managed correctly. My initial thinking is that the fix is to check and see if auditd is connected in kauditd_retry_skb(), if it isn't we skip the retry queue and call kauditd_hold_skb(), if auditd is connected we add the record to the retry queue (what we currently do). -- paul moore www.paul-moore.com