Re: [PATCH 2/2] tracefs: Don't overlay 'struct inode'

2024-08-07 Thread Mathias Krause
On 07.08.24 17:49, Steven Rostedt wrote: > [...] > > So I could use destroy_inode() for the removing of the link list, and then > free_inode to free it. Something like: > > diff --git a/fs/tracefs/inode.c b/fs/tracefs/inode.c > index 1028ab6d9a74..ae2cb2221acd 100644 > --- a/fs/tracefs/inode.c >

Re: [PATCH 2/2] tracefs: Don't overlay 'struct inode'

2024-08-07 Thread Mathias Krause
On 07.08.24 15:44, Al Viro wrote: > On Wed, Aug 07, 2024 at 09:35:45AM -0400, Steven Rostedt wrote: > >> 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 +

Re: [PATCH 2/2] tracefs: Don't overlay 'struct inode'

2024-08-07 Thread Mathias Krause
On 07.08.24 15:35, Steven Rostedt wrote: > On Wed, 7 Aug 2024 13:51:39 +0200 > Mathias Krause 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

Re: [PATCH 2/2] tracefs: Don't overlay 'struct inode'

2024-08-07 Thread Steven Rostedt
On Wed, 7 Aug 2024 14:44:53 +0100 Al Viro wrote: > On Wed, Aug 07, 2024 at 09:35:45AM -0400, Steven Rostedt wrote: > > > 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/i

Re: [PATCH 2/2] tracefs: Don't overlay 'struct inode'

2024-08-07 Thread Al Viro
On Wed, Aug 07, 2024 at 09:35:45AM -0400, Steven Rostedt wrote: > 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_

Re: [PATCH 2/2] tracefs: Don't overlay 'struct inode'

2024-08-07 Thread Steven Rostedt
On Wed, 7 Aug 2024 13:51:39 +0200 Mathias Krause 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

[PATCH 2/2] tracefs: Don't overlay 'struct inode'

2024-08-07 Thread Mathias Krause
With structure layout randomization enabled for 'struct inode' we need to avoid overlapping any of the RCU-used / initialized-only-once members, e.g. i_lru or i_sb_list to not corrupt related list traversals when making use of the rcu_head. For an unlucky structure layout of 'struct inode' we may