Received: by 10.223.185.116 with SMTP id b49csp885818wrg; Wed, 14 Feb 2018 08:25:15 -0800 (PST) X-Google-Smtp-Source: AH8x224NYRsJNhebILESHaRkWE3Q3JObhNgusYF6TSxkFLaVuhkUrYJdmVAHafyDEEvZiZRnLXqV X-Received: by 10.98.13.72 with SMTP id v69mr5312193pfi.36.1518625515282; Wed, 14 Feb 2018 08:25:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518625515; cv=none; d=google.com; s=arc-20160816; b=IPt4LXOMpuimwQXqPFROZ9jBvAQ3PWAKbcd2cIr4R3zncQcL/QkRHPznpYpE7zDg4g Ho6fX0KHmr1O8gGN8IiwLbKiqbdtuDgIJqGN7Ulp6GUN31YQqzJjtIIaDZHq3eZLqPQB krieTyXH2N3rhryjmO0nDm8/SWqV65bcEjrz7d8G3vP1BeQELZ0FFBNbFUIiA0kJQfkx m/zRf6r+5zKzvp4Ia2xKIKYcDqdsXzz3K48lROzWExnVIvuT689qb8e3+A8F4fzUi1Fi cPPFqBaFZI7RncfVIA64UJVf3GEj/LB6PUmeGFz3uA36dgDdKskL9AfaLSbdkW+SO3eD v/zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=+8r1v76Vsk6trODYHcSlI4in/adA/YdDyjizm0GCKbE=; b=Ogm+3mNvsQRaF8UrjYlpd8RI9R8JMDcjywK2iZOLpBFHTzAS3w2yqooO9v2NMBVZ1p bCSXETQL8lkKwV4yAVEbkUEFj2QXaOcD023qLj4fQfjaCoBagfXybmUz27140F/9TvmG eVEfOd4i7o6oWNdW3xkgLVn41a9mWHUDVexFB4IzGD5I48IAF64DgvSiR60+9pnVhvAy Xqr5iTVVwJ9st/8Vn19Q5sxd4YczJiCDgXtAxtZTK3nmozOMZaUG97KGbjfco1uuavpS tpnheKrAkyboGMOlLNWyf+vsUVIn0M70VLbl8zAKHBZLXpvUQuLwb+5vMfwxkVho8vkG TETA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x23-v6si1189793pln.423.2018.02.14.08.24.57; Wed, 14 Feb 2018 08:25:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1032460AbeBNQWz (ORCPT + 99 others); Wed, 14 Feb 2018 11:22:55 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36046 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032446AbeBNQWx (ORCPT ); Wed, 14 Feb 2018 11:22:53 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 50CCD40FB652; Wed, 14 Feb 2018 16:22:53 +0000 (UTC) Received: from madcap2.tricolour.ca (ovpn-112-12.rdu2.redhat.com [10.10.112.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id C51701008399; Wed, 14 Feb 2018 16:22:51 +0000 (UTC) From: Richard Guy Briggs To: Linux-Audit Mailing List , LKML Cc: Eric Paris , Paul Moore , Steve Grubb , Kees Cook , Richard Guy Briggs Subject: [RFC PATCH ghak21 1/4] audit: make ANOM_LINK obey audit_enabled and audit_dummy_context Date: Wed, 14 Feb 2018 11:18:21 -0500 Message-Id: <3a9542b261d93bc4eaecfaf359affbba152cf965.1518603831.git.rgb@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 14 Feb 2018 16:22:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Wed, 14 Feb 2018 16:22:53 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'rgb@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Audit link denied events emit disjointed records when audit is disabled. No records should be emitted when audit is disabled. See: https://github.com/linux-audit/audit-kernel/issues/21 Signed-off-by: Richard Guy Briggs --- kernel/audit.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/audit.c b/kernel/audit.c index 227db99..4c3fd24 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -2261,6 +2261,9 @@ void audit_log_link_denied(const char *operation, const struct path *link) struct audit_buffer *ab; struct audit_names *name; + if (!audit_enabled || audit_dummy_context()) + return; + name = kzalloc(sizeof(*name), GFP_NOFS); if (!name) return; -- 1.8.3.1