Received: by 10.213.65.16 with SMTP id m16csp194434imf; Sun, 11 Mar 2018 23:39:10 -0700 (PDT) X-Google-Smtp-Source: AG47ELtbVj5HA5VO3+kW+4DH2VQqTNJyAfy3g8ptVV7Re9vUDLJxpADEZ3Cz2/wpfw868uYfIRJT X-Received: by 2002:a17:902:8f95:: with SMTP id z21-v6mr7194603plo.132.1520836750615; Sun, 11 Mar 2018 23:39:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520836750; cv=none; d=google.com; s=arc-20160816; b=PHx2gIShnPVzxwG3eqBMTGNHAhy7TzkZrzJGXJ/UA83XJnSXcESFTafwXCK4+9d7sE Uc6/1AG9VmZMmBezCkReBupR41QCrN/kteHOh+82dA1Q2t3qgWhQbkFtVYY3KhkSxLoe 9O/5wx4xFEgBtVk+0jmitok+nEHSqfTl1hMtSV2r8BjQ6HF9GpJPw19B+SZZ+TliaO2K eSNXNeut4cR/BcqgpC6TiYskYXPtLERSx/194RyJPqh4XHHO6aOQXs2lIieOkorPYPB4 jE6ynb+Uqnn/itMVuLvlCHslCEoXD2vkhM3Eid1+5RJkVW6aqBGTIsJsPYChWTkhtUL3 0k0A== 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=MOGFiMKxdGCjqthc/oiyE0Y2FT6nadvclv9kuMY3o9M=; b=ESrJCXT8T4RbaTbmhLHi6omvoZqQezYBJIGw57ipHEvdUcd7Wwq7jWyrKlMMUUEubs nzHsgRUvEt+FLqh0OblvksrPZM4u6rN/qbtcC+cUV8pirvhQKEIgDat4SOWrlbAkWhVS slNp2bCJ6o6MGG6HuNF/WisfFkD7AAWXh102cA8+NtTkc8XxEyOpeg0BsZikf3yufWW6 rBWs8U2jMaXoAFCW5Tf2S4SwX0+cXgJOugswLfLjVgahyPhfZzsBRoKNfDTHvaDp9NGL 1teZD3BwfQPqYEMORdID6sSMkTUVp8OzYpKQ2AMqOGw6peatHol16LhzYYuqNmu3p6x7 corw== 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 1-v6si5526034plx.24.2018.03.11.23.38.56; Sun, 11 Mar 2018 23:39:10 -0700 (PDT) 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 S1751930AbeCLGga (ORCPT + 99 others); Mon, 12 Mar 2018 02:36:30 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:55248 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750752AbeCLGg3 (ORCPT ); Mon, 12 Mar 2018 02:36:29 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D9D40401C9AE; Mon, 12 Mar 2018 06:36:28 +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 65E1A1C71E; Mon, 12 Mar 2018 06:36:27 +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: [PATCH ghak21 V2 1/4] audit: make ANOM_LINK obey audit_enabled and audit_dummy_context Date: Mon, 12 Mar 2018 02:31:17 -0400 Message-Id: <6b1842619a6f1ba13194328e28b853c18c466c03.1520835596.git.rgb@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 12 Mar 2018 06:36:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Mon, 12 Mar 2018 06:36:28 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.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 1a3e75d..7026d69 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -2308,6 +2308,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