public inbox for audit@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Mateusz Guzik <mjguzik@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>,
	Al Viro <viro@zeniv.linux.org.uk>,  Jan Kara <jack@suse.cz>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-kernel	 <linux-kernel@vger.kernel.org>,
	audit@vger.kernel.org, Paul Moore	 <paul@paul-moore.com>,
	Eric Paris <eparis@redhat.com>
Subject: Re: audit_reusename in getname_flags
Date: Thu, 06 Feb 2025 15:24:24 -0500	[thread overview]
Message-ID: <956b43574bcb149579ecac7a3ab98ad29dddc275.camel@kernel.org> (raw)
In-Reply-To: <CAGudoHFLnmp3tQHOwUAFBKxrno=ejxHmJXta=sTxVMtN9L1T9w@mail.gmail.com>

On Thu, 2025-02-06 at 20:07 +0100, Mateusz Guzik wrote:
> You added it in:
> commit 7ac86265dc8f665cc49d6e60a125e608cd2fca14
> Author: Jeff Layton <jlayton@kernel.org>
> Date:   Wed Oct 10 15:25:28 2012 -0400
> 
>     audit: allow audit code to satisfy getname requests from its names_list
> 
> Do I read correctly this has no user-visible impact, but merely tries
> to shave off some memory usage in case of duplicated user bufs?
> 
> This is partially getting in the way of whacking atomics for filename
> ref management (but can be worked around).
> 
> AFAIU this change is not all *that* beneficial in its own right, so
> should not be a big deal to whack it regardless of what happens with
> refs? Note it would also remove some branches in the common case as
> normally audit either has dummy context or there is no match anyway.


(cc'ing audit folks and mailing list)

IIRC, having duplicate audit_names records can cause audit to emit
extra name records in this loop in audit_log_exit():

        list_for_each_entry(n, &context->names_list, list) { 
                if (n->hidden)
                        continue;
                audit_log_name(context, n, NULL, i++, &call_panic);
        }


...which is something you probably want to avoid.
-- 
Jeff Layton <jlayton@kernel.org>

       reply	other threads:[~2025-02-06 20:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAGudoHFLnmp3tQHOwUAFBKxrno=ejxHmJXta=sTxVMtN9L1T9w@mail.gmail.com>
2025-02-06 20:24 ` Jeff Layton [this message]
2025-02-06 20:34   ` audit_reusename in getname_flags Mateusz Guzik
2025-02-06 22:10     ` Mateusz Guzik

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=956b43574bcb149579ecac7a3ab98ad29dddc275.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=audit@vger.kernel.org \
    --cc=brauner@kernel.org \
    --cc=eparis@redhat.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjguzik@gmail.com \
    --cc=paul@paul-moore.com \
    --cc=viro@zeniv.linux.org.uk \
    /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