Re: [PATCH v2] audit: Avoid excessive dput/dget in audit_context setup and reset paths

Al Viro <[email protected]>
Newsgroups org.kernel.vger.audit,org.kernel.vger.linux-kernel
Message-ID <20260203200505.GH3183987@ZenIV>
On Tue, Feb 03, 2026 at 02:44:33PM -0500, Waiman Long wrote:

> diff --git a/kernel/audit.h b/kernel/audit.h
> index 7c401729e21b..03f3539b10e7 100644
> --- a/kernel/audit.h
> +++ b/kernel/audit.h
> @@ -133,6 +133,13 @@ struct audit_context {
>  	int		    name_count; /* total records in names_list */
>  	struct list_head    names_list;	/* struct audit_names->list anchor */
>  	char		    *filterkey;	/* key for rule that triggered record */
> +	/*
> +	 * pwd_reset is set if audit_free_names() has been called from
> +	 * audit_reset_context() to reset pwd, but pwd is still holding dentry
> +	 * and mount references to be used in later audit action without
> +	 * the need to reacqure the references again.

That's a delicate way to say "we have mounts stuck busy inexplicably for userland"...

Generally a chdir(2) away from something immediately followed by umount(2)
is _not_ expected to leave you with -EBUSY when nobody else has been doing
anything with the mount in question.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.