From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753262AbbIRJNl (ORCPT ); Fri, 18 Sep 2015 05:13:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47796 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752822AbbIRJNj (ORCPT ); Fri, 18 Sep 2015 05:13:39 -0400 Date: Fri, 18 Sep 2015 10:13:41 +0100 From: Steve Grubb To: Richard Guy Briggs Cc: linux-audit@redhat.com, linux-kernel@vger.kernel.org, pmoore@redhat.com, eparis@redhat.com, v.rathor@gmail.com, ctcard@hotmail.com Subject: Re: [PATCH] fixup! audit: try harder to send to auditd upon netlink failure Message-ID: <20150918101341.205b02b4@ivy-bridge> In-Reply-To: <89a693758cd8f511892fe54c2e4aaf2cfca89e89.1442562580.git.rgb@redhat.com> References: <89a693758cd8f511892fe54c2e4aaf2cfca89e89.1442562580.git.rgb@redhat.com> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 18 Sep 2015 03:52:43 -0400 Richard Guy Briggs wrote: > A bug was introduced by "audit: try harder to send to auditd upon > netlink failure", caused by incomplete code and a function that > expects a string and does not accept a format plus arguments. Create > a temporary string variable to assemble the output text. It could be > merged as a fixup if it is not yet upstream. > > Signed-off-by: Richard Guy Briggs > --- > kernel/audit.c | 5 ++++- > 1 files changed, 4 insertions(+), 1 deletions(-) > > diff --git a/kernel/audit.c b/kernel/audit.c > index 18cdfe2..60913e6 100644 > --- a/kernel/audit.c > +++ b/kernel/audit.c > @@ -420,7 +420,10 @@ restart: > if (audit_pid) { > if (err == -ECONNREFUSED || err == -EPERM > || ++attempts >= AUDITD_RETRIES) { > - audit_log_lost("audit_pid=%d reset"); > + char s[32]; > + > + sprintf(s, "audit_pid=%d reset", > audit_pid); We normally use name=value for everything important. Reset by itself will get dropped by auparse. action=reset (or something similar) would be better. -Steve > + audit_log_lost(s); > audit_pid = 0; > audit_sock = NULL; > } else {