lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Thu, 2 May 2024 11:30:03 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org
Cc: Masami Hiramatsu <mhiramat@...nel.org>, Mark Rutland
 <mark.rutland@....com>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
 Andrew Morton <akpm@...ux-foundation.org>, stable@...r.kernel.org
Subject: Re: [PATCH v2 1/5] tracefs: Reset permissions on remount if
 permissions are options

On Thu, 02 May 2024 11:15:48 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:

> +/*
> + * On a remount of tracefs, if UID or GID options are set, then
> + * the mount point inode permissions should be used.
> + * Reset the saved permission flags appropriately.
> + */
> +void eventfs_remount(struct tracefs_inode *ti, bool update_uid, bool update_gid)
> +{
> +	struct eventfs_inode *ei = ti->private;

And I just realized there's a race here too :-p

I need to set ti->private = NULL before freeing the ei, and probably free
the ei via RCU.

-- Steve


> +
> +	if (!ei)
> +		return;
> +
> +	if (update_uid)
> +		ei->attr.mode &= ~EVENTFS_SAVE_UID;
> +
> +	if (update_gid)
> +		ei->attr.mode &= ~EVENTFS_SAVE_GID;
> +
> +	if (!ei->entry_attrs)
> +		return;
> +
> +	for (int i = 0; i < ei->nr_entries; i++) {
> +		if (update_uid)
> +			ei->entry_attrs[i].mode &= ~EVENTFS_SAVE_UID;
> +		if (update_gid)
> +			ei->entry_attrs[i].mode &= ~EVENTFS_SAVE_GID;
> +	}
> +}
> +

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ