Received: by 10.223.185.116 with SMTP id b49csp884794wrg; Wed, 14 Feb 2018 08:24:20 -0800 (PST) X-Google-Smtp-Source: AH8x225cnXV7HGkBlIcddFScOW5EEqeYdXDRtGzmYiMerF7vzSP/f6OqBQKMFQVw6PHFUQ9SEVDz X-Received: by 10.99.99.66 with SMTP id x63mr4323298pgb.421.1518625460077; Wed, 14 Feb 2018 08:24:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518625460; cv=none; d=google.com; s=arc-20160816; b=BxR5vSnRs+R/L244itDNs5pH6iBhFfFIzXnx2ojIbSJ24nK3W1oCSR6VLThd0WvqAB GkHGGD71UMbFlcmI+cZrivxQoaliFBUoxrTFR/uzFEX3l1mpuhjOX2Ik9p0gKXwAylMI gST5AVCQCufXEwsWsuCQmp6uklD0GzJOoF29t9vC5UTQFc/HpqNngNhhydj4el6xvu8c 38hyx5FiYJl11GCAHWas31D0ODkr6eduN6ueoOSyD5+PQ9qwBgnGJzCnPzQwtUBM90DQ HqmikXaP0e6bGYhqbGwADgAZk0IamcvCGGINiTxtwCJQnXLwcaFVyJIXMieGlzw++p2g g9CQ== 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=mgsdUYTtV3bu7giJp9tEMeaF8luc4Nr7VikcQk8W1Eo=; b=OYHkUMdble2das+3O/UJVmfVhJLqy8WpcYWSEVKO4AZM+gMNHHA1le5LiV5+Ur4Gls WEt36abAfbDSiIqwM6L+t990udHG8Ad1m62ioI4nZ2MGBbEuStNDWWhfwnDwjnBZcMnZ 4FBoac1FffjwunfOFlwp7i3AhgMcrFnzTF/T95El4VreqJJ1GDQ3uijVXSuRsivtxOOY 4f5V9PAqpY83dvWdxHX3xGCEX4wnndJhF7bp0+P6zuL06zdS7hKL34qYBI+ePDYwuqG4 AVkAPzBuoWqIJemwd53MvfQehvOngXkjhOumppfOWQWvANPU0z33nEhirt27Gvzei+i5 25vw== 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-v6si3051364ple.726.2018.02.14.08.24.04; Wed, 14 Feb 2018 08:24:20 -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 S1032474AbeBNQW6 (ORCPT + 99 others); Wed, 14 Feb 2018 11:22:58 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34454 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1032462AbeBNQWz (ORCPT ); Wed, 14 Feb 2018 11:22:55 -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 2893180D2EC8; Wed, 14 Feb 2018 16:22:55 +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 9D3CF1010409; Wed, 14 Feb 2018 16:22:53 +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 2/4] audit: link denied should not directly generate PATH record Date: Wed, 14 Feb 2018 11:18:22 -0500 Message-Id: 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.8]); Wed, 14 Feb 2018 16:22:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.8]); Wed, 14 Feb 2018 16:22:55 +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 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(-) 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