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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240807093545.4ec51d61@gandalf.local.home>
Date: Wed, 7 Aug 2024 09:35:45 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Mathias Krause <minipli@...ecurity.net>
Cc: Masami Hiramatsu <mhiramat@...nel.org>, Mathieu Desnoyers
 <mathieu.desnoyers@...icios.com>, Ajay Kaher <ajay.kaher@...adcom.com>,
 linux-trace-kernel@...r.kernel.org, linux-kernel@...r.kernel.org, Ilkka
 Naulapää <digirigawa@...il.com>, Al Viro
 <viro@...iv.linux.org.uk>, Brad Spengler <spender@...ecurity.net>
Subject: Re: [PATCH 2/2] tracefs: Don't overlay 'struct inode'

On Wed,  7 Aug 2024 13:51:39 +0200
Mathias Krause <minipli@...ecurity.net> wrote:

> diff --git a/fs/tracefs/internal.h b/fs/tracefs/internal.h
> index f704d8348357..a7769857962a 100644
> --- a/fs/tracefs/internal.h
> +++ b/fs/tracefs/internal.h
> @@ -10,10 +10,8 @@ enum {
>  };
>  
>  struct tracefs_inode {
> -	union {
> -		struct inode            vfs_inode;
> -		struct rcu_head		rcu;
> -	};
> +	struct inode		vfs_inode;
> +	struct rcu_head		rcu;

I rather not make this structure any bigger for the rcu element that is not
used until freed.

>  	/* The below gets initialized with memset_after(ti, 0, vfs_inode) */
>  	struct list_head	list;
>  	unsigned long           flags;

Perhaps:

diff --git a/fs/tracefs/internal.h b/fs/tracefs/internal.h
index f704d8348357..ab6d6c3d835d 100644
--- a/fs/tracefs/internal.h
+++ b/fs/tracefs/internal.h
@@ -10,12 +10,12 @@ enum {
 };
 
 struct tracefs_inode {
+	struct inode            vfs_inode;
+	/* The below gets initialized with memset_after(ti, 0, vfs_inode) */
 	union {
-		struct inode            vfs_inode;
+		struct list_head	list;
 		struct rcu_head		rcu;
 	};
-	/* The below gets initialized with memset_after(ti, 0, vfs_inode) */
-	struct list_head	list;
 	unsigned long           flags;
 	void                    *private;
 };


-- Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ