On Wed,  7 Aug 2024 13:51:39 +0200
Mathias Krause <mini...@grsecurity.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

Reply via email to