mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Richard Guy Briggs <rgb@redhat.com>
To: Linux-Audit Mailing List <linux-audit@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>
Cc: Eric Paris <eparis@redhat.com>, Paul Moore <paul@paul-moore.com>,
	Steve Grubb <sgrubb@redhat.com>,
	Kees Cook <keescook@chromium.org>,
	Richard Guy Briggs <rgb@redhat.com>
Subject: [RFC PATCH ghak21 2/4] audit: link denied should not directly generate PATH record
Date: Wed, 14 Feb 2018 11:18:22 -0500	[thread overview]
Message-ID: <f48d5d1f1e429e2dee817ae723f9a02a67ed1f3b.1518603831.git.rgb@redhat.com> (raw)
In-Reply-To: <cover.1518603831.git.rgb@redhat.com>
In-Reply-To: <cover.1518603831.git.rgb@redhat.com>

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 <rgb@redhat.com>
---
 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

  parent reply	other threads:[~2018-02-14 16:22 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14 16:18 [RFC PATCH ghak21 0/4] audit: address ANOM_LINK excess records Richard Guy Briggs
2018-02-14 16:18 ` [RFC PATCH ghak21 1/4] audit: make ANOM_LINK obey audit_enabled and audit_dummy_context Richard Guy Briggs
2018-02-14 17:51   ` Kees Cook
2018-02-15  2:33     ` Richard Guy Briggs
2018-02-15  6:16       ` Kees Cook
2018-02-15 22:51         ` Paul Moore
2018-03-09  0:23           ` Paul Moore
2018-02-14 16:18 ` Richard Guy Briggs [this message]
2018-03-09  0:26   ` [RFC PATCH ghak21 2/4] audit: link denied should not directly generate PATH record Paul Moore
2018-03-12  8:01     ` Richard Guy Briggs
2018-02-14 16:18 ` [RFC PATCH ghak21 3/4] audit: add refused symlink to audit_names Richard Guy Briggs
2018-03-09  0:30   ` Paul Moore
2018-03-09  0:33     ` Paul Moore
2018-02-14 16:18 ` [RFC PATCH ghak21 4/4] audit: add parent of " Richard Guy Briggs
2018-02-15 23:34   ` Paul Moore
2018-02-16  2:59     ` Richard Guy Briggs
2018-02-16 18:56       ` Paul Moore
2018-03-09  0:50   ` Paul Moore
2018-03-12  7:59     ` Richard Guy Briggs
2018-03-12 15:47       ` Paul Moore
2018-02-14 16:49 ` [RFC PATCH ghak21 0/4] audit: address ANOM_LINK excess records Steve Grubb
2018-02-15  3:46   ` Richard Guy Briggs
2018-03-08 11:47     ` Richard Guy Briggs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f48d5d1f1e429e2dee817ae723f9a02a67ed1f3b.1518603831.git.rgb@redhat.com \
    --to=rgb@redhat.com \
    --cc=eparis@redhat.com \
    --cc=keescook@chromium.org \
    --cc=linux-audit@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul@paul-moore.com \
    --cc=sgrubb@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®