Received: by 10.213.65.16 with SMTP id m16csp223242imf; Mon, 12 Mar 2018 01:07:49 -0700 (PDT) X-Google-Smtp-Source: AG47ELvYEa9TvnGNLXfM+Ovikebosk8UEWdOF8I5TqtVekCw2WwvtH1unAXTEwdJGB128DPPdRYE X-Received: by 2002:a17:902:b943:: with SMTP id h3-v6mr7493659pls.45.1520842069325; Mon, 12 Mar 2018 01:07:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520842069; cv=none; d=google.com; s=arc-20160816; b=ctPNaOck/xw3faA74VPnS2QiFrQKB/xHK7Rk3QXWQLNxr3KvTNZviF+U6GcFGSk+7t lc++qFIsM2tD7Aq6RVHkKvgrDwtRVunnJpQbcxcq+M6uS3ytvPfaW9J93c1KeXhlOCcZ ldxAeH229yXlvB7Bkan6bIdENmdJhzOXnHSwQIOlAqMbCjpEG7V4zRcAcjkuwZhx/0BU E90Jt0/jcdIKB8oUXqi5NFbZUS+k9GyBAL3GEwwaBEo+CgoQI+TIoFcoCQSM258wqGcD Q/Uevsono1DHILkT1PEiKa/fxE1d6MYqByf1oWHrLjGfz5OqK2JWI5blianaU9PXUmSu Jarg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=gqzlOOUHkv0G12pbItNxvtYfF7ktWFe6LB+E9XQgoVM=; b=trDNSfm8U+pzRNbddghAwarabb404T8wR376p/zPxEOSPHslyGynSM6BvP3lwFByTM XUfRIIEqYba07AmsjYAhPrJAUcjAHX2eCmNRdbO1Zb9ueJZrECKrDieBhVgM4rYiZYSB tq+8gAZx1A1AdKxDBqR0i0/065Y/OKYlxuzQN1AHeic+tak1A27hlfIB0QlkTNuKyRsH nlZ35RDJrHjxXe2EXoenlT0Xj8fRWXQL5o3z6uA+7o9YSezzvsgRGkAr7oITS/lmGQNE LE9dZNishb5NjQ1FwARlPxGpB8Ndk6fEaAFJbxTx86XxeH3ZTp1Dvzmokv5dgwKbYGgY zcYg== 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 g2-v6si5853269plm.454.2018.03.12.01.07.35; Mon, 12 Mar 2018 01:07:49 -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 S1752358AbeCLIGR (ORCPT + 99 others); Mon, 12 Mar 2018 04:06:17 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34396 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751239AbeCLIGP (ORCPT ); Mon, 12 Mar 2018 04:06:15 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D783FBD9E; Mon, 12 Mar 2018 08:06:14 +0000 (UTC) Received: from madcap2.tricolour.ca (ovpn-112-12.rdu2.redhat.com [10.10.112.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 46EA92026E03; Mon, 12 Mar 2018 08:06:13 +0000 (UTC) Date: Mon, 12 Mar 2018 04:01:34 -0400 From: Richard Guy Briggs To: Paul Moore Cc: Linux-Audit Mailing List , LKML , Eric Paris , Steve Grubb , Kees Cook Subject: Re: [RFC PATCH ghak21 2/4] audit: link denied should not directly generate PATH record Message-ID: <20180312080134.lxix6zbamjaf3x4x@madcap2.tricolour.ca> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171027 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 12 Mar 2018 08:06:14 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Mon, 12 Mar 2018 08:06:14 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.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 On 2018-03-08 19:26, Paul Moore wrote: > On Wed, Feb 14, 2018 at 11:18 AM, Richard Guy Briggs wrote: > > Audit link denied events generate duplicate PATH records which disagree > > in different ways from symlink and hardlink denials. > > audit_log_link_denied() should not directly generate PATH records. > > > > See: https://github.com/linux-audit/audit-kernel/issues/21 > > Signed-off-by: Richard Guy Briggs > > --- > > kernel/audit.c | 14 +------------- > > 1 file changed, 1 insertion(+), 13 deletions(-) > > Merged, thanks. Self-NACK. Please un-merge this RFC v1 version and merge instead the v2 patch since it removes the now-unnecessary struct path * parameter from audit_log_link_denied(). > > diff --git a/kernel/audit.c b/kernel/audit.c > > index 4c3fd24..683b249 100644 > > --- a/kernel/audit.c > > +++ b/kernel/audit.c > > @@ -2259,31 +2259,19 @@ void audit_log_task_info(struct audit_buffer *ab, struct task_struct *tsk) > > 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; > > - > > /* Generate AUDIT_ANOM_LINK with subject, operation, outcome. */ > > ab = audit_log_start(current->audit_context, GFP_KERNEL, > > AUDIT_ANOM_LINK); > > if (!ab) > > - goto out; > > + return; > > audit_log_format(ab, "op=%s", operation); > > audit_log_task_info(ab, current); > > audit_log_format(ab, " res=0"); > > audit_log_end(ab); > > - > > - /* Generate AUDIT_PATH record with object. */ > > - name->type = AUDIT_TYPE_NORMAL; > > - audit_copy_inode(name, link->dentry, d_backing_inode(link->dentry)); > > - audit_log_name(current->audit_context, name, link, 0, NULL); > > -out: > > - kfree(name); > > } > > > > /** > > -- > > 1.8.3.1 > > > > > > -- > paul moore > www.paul-moore.com - RGB -- Richard Guy Briggs Sr. S/W Engineer, Kernel Security, Base Operating Systems Remote, Ottawa, Red Hat Canada IRC: rgb, SunRaycer Voice: +1.647.777.2635, Internal: (81) 32635