Re: [PATCH 04/64] stddef: Introduce struct_group() helper macro

2021-07-31 Thread Kees Cook
On Sat, Jul 31, 2021 at 07:24:44AM +0200, Rasmus Villemoes wrote: > On Sat, Jul 31, 2021, 04:59 Kees Cook wrote: > > > On Fri, Jul 30, 2021 at 10:19:20PM +, Williams, Dan J wrote: > > > On Wed, 2021-07-28 at 14:59 -0700, Kees Cook wrote: > > > > > /** > > > * struct_group(NAME, MEMBERS) >

Re: [PATCH 04/64] stddef: Introduce struct_group() helper macro

2021-07-30 Thread Rasmus Villemoes
On Sat, Jul 31, 2021, 04:59 Kees Cook wrote: > On Fri, Jul 30, 2021 at 10:19:20PM +, Williams, Dan J wrote: > > On Wed, 2021-07-28 at 14:59 -0700, Kees Cook wrote: > > > /** > > * struct_group(NAME, MEMBERS) > > * > > @@ -67,7 +73,10 @@ enum { > > * @NAME: The name of the mirrored sub-

Re: [PATCH 04/64] stddef: Introduce struct_group() helper macro

2021-07-30 Thread Kees Cook
On Fri, Jul 30, 2021 at 10:19:20PM +, Williams, Dan J wrote: > On Wed, 2021-07-28 at 14:59 -0700, Kees Cook wrote: > > On Wed, Jul 28, 2021 at 12:54:18PM +0200, Rasmus Villemoes wrote: > > > On 27/07/2021 22.57, Kees Cook wrote: > > > > > > > In order to have a regular programmatic way to desc

Re: [PATCH 04/64] stddef: Introduce struct_group() helper macro

2021-07-30 Thread Williams, Dan J
On Wed, 2021-07-28 at 14:59 -0700, Kees Cook wrote: > On Wed, Jul 28, 2021 at 12:54:18PM +0200, Rasmus Villemoes wrote: > > On 27/07/2021 22.57, Kees Cook wrote: > > > > > In order to have a regular programmatic way to describe a struct > > > region that can be used for references and sizing, can

Re: [PATCH 04/64] stddef: Introduce struct_group() helper macro

2021-07-28 Thread Kees Cook
On Wed, Jul 28, 2021 at 12:54:18PM +0200, Rasmus Villemoes wrote: > On 27/07/2021 22.57, Kees Cook wrote: > > > In order to have a regular programmatic way to describe a struct > > region that can be used for references and sizing, can be examined for > > bounds checking, avoids forcing the use of

Re: [PATCH 04/64] stddef: Introduce struct_group() helper macro

2021-07-28 Thread Rasmus Villemoes
On 27/07/2021 22.57, Kees Cook wrote: > In order to have a regular programmatic way to describe a struct > region that can be used for references and sizing, can be examined for > bounds checking, avoids forcing the use of intermediate identifiers, > and avoids polluting the global namespace, intr

Re: [PATCH 04/64] stddef: Introduce struct_group() helper macro

2021-07-27 Thread Gustavo A. R. Silva
On Tue, Jul 27, 2021 at 01:57:55PM -0700, Kees Cook wrote: > Kernel code has a regular need to describe groups of members within a > structure usually when they need to be copied or initialized separately > from the rest of the surrounding structure. The generally accepted design > pattern in C is