All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] uapi: stddef.h: Provide UAPI macros for __counted_by_{le, be}
@ 2024-05-06 17:42 Erick Archer
  2024-05-06 17:48 ` Miguel Ojeda
  2024-05-07 12:58 ` Alexander Lobakin
  0 siblings, 2 replies; 4+ messages in thread
From: Erick Archer @ 2024-05-06 17:42 UTC (permalink / raw
  To: Kees Cook, Alexey Dobriyan, Erick Archer, Miguel Ojeda,
	Nathan Chancellor, Dmitry Antipov, Gustavo A. R. Silva,
	Justin Stitt
  Cc: linux-kernel, linux-hardening

Provide UAPI macros for UAPI structs that will gain annotations for
__counted_by_{le, be} attributes.

Signed-off-by: Erick Archer <erick.archer@outlook.com>
---
 include/uapi/linux/stddef.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/uapi/linux/stddef.h b/include/uapi/linux/stddef.h
index 2ec6f35cda32..58154117d9b0 100644
--- a/include/uapi/linux/stddef.h
+++ b/include/uapi/linux/stddef.h
@@ -55,4 +55,12 @@
 #define __counted_by(m)
 #endif
 
+#ifndef __counted_by_le
+#define __counted_by_le(m)
+#endif
+
+#ifndef __counted_by_be
+#define __counted_by_be(m)
+#endif
+
 #endif /* _UAPI_LINUX_STDDEF_H */
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] uapi: stddef.h: Provide UAPI macros for __counted_by_{le, be}
  2024-05-06 17:42 [PATCH] uapi: stddef.h: Provide UAPI macros for __counted_by_{le, be} Erick Archer
@ 2024-05-06 17:48 ` Miguel Ojeda
  2024-05-07 12:58 ` Alexander Lobakin
  1 sibling, 0 replies; 4+ messages in thread
From: Miguel Ojeda @ 2024-05-06 17:48 UTC (permalink / raw
  To: Erick Archer
  Cc: Kees Cook, Alexey Dobriyan, Miguel Ojeda, Nathan Chancellor,
	Dmitry Antipov, Gustavo A. R. Silva, Justin Stitt, linux-kernel,
	linux-hardening

On Mon, May 6, 2024 at 7:42 PM Erick Archer <erick.archer@outlook.com> wrote:
>
> Provide UAPI macros for UAPI structs that will gain annotations for
> __counted_by_{le, be} attributes.
>
> Signed-off-by: Erick Archer <erick.archer@outlook.com>

I guess this is a mirror of the kernel one at
https://lore.kernel.org/lkml/20240327142241.1745989-1-aleksander.lobakin@intel.com/,
but it would be nice to add some context, e.g. Link: tag, to this, and
possibly a comment or two.

Thanks!

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] uapi: stddef.h: Provide UAPI macros for __counted_by_{le, be}
  2024-05-06 17:42 [PATCH] uapi: stddef.h: Provide UAPI macros for __counted_by_{le, be} Erick Archer
  2024-05-06 17:48 ` Miguel Ojeda
@ 2024-05-07 12:58 ` Alexander Lobakin
  2024-05-11 11:04   ` Erick Archer
  1 sibling, 1 reply; 4+ messages in thread
From: Alexander Lobakin @ 2024-05-07 12:58 UTC (permalink / raw
  To: Erick Archer
  Cc: Kees Cook, Alexey Dobriyan, Miguel Ojeda, Nathan Chancellor,
	Dmitry Antipov, Gustavo A. R. Silva, Justin Stitt, linux-kernel,
	linux-hardening

From: Erick Archer <erick.archer@outlook.com>
Date: Mon,  6 May 2024 19:42:08 +0200

> Provide UAPI macros for UAPI structs that will gain annotations for
> __counted_by_{le, be} attributes.

Pls add me to Cc next time.

Why is this change needed? __counted_by_{le, be}() aren't used anywhere
in the uAPI headers.

> 
> Signed-off-by: Erick Archer <erick.archer@outlook.com>
> ---
>  include/uapi/linux/stddef.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/include/uapi/linux/stddef.h b/include/uapi/linux/stddef.h
> index 2ec6f35cda32..58154117d9b0 100644
> --- a/include/uapi/linux/stddef.h
> +++ b/include/uapi/linux/stddef.h
> @@ -55,4 +55,12 @@
>  #define __counted_by(m)
>  #endif
>  
> +#ifndef __counted_by_le
> +#define __counted_by_le(m)
> +#endif
> +
> +#ifndef __counted_by_be
> +#define __counted_by_be(m)
> +#endif
> +
>  #endif /* _UAPI_LINUX_STDDEF_H */

Thanks,
Olek

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] uapi: stddef.h: Provide UAPI macros for __counted_by_{le, be}
  2024-05-07 12:58 ` Alexander Lobakin
@ 2024-05-11 11:04   ` Erick Archer
  0 siblings, 0 replies; 4+ messages in thread
From: Erick Archer @ 2024-05-11 11:04 UTC (permalink / raw
  To: Alexander Lobakin
  Cc: Erick Archer, Kees Cook, Alexey Dobriyan, Miguel Ojeda,
	Nathan Chancellor, Dmitry Antipov, Gustavo A. R. Silva,
	Justin Stitt, linux-kernel, linux-hardening

Hi Alexander,

On Tue, May 07, 2024 at 02:58:15PM +0200, Alexander Lobakin wrote:
> From: Erick Archer <erick.archer@outlook.com>
> Date: Mon,  6 May 2024 19:42:08 +0200
> 
> > Provide UAPI macros for UAPI structs that will gain annotations for
> > __counted_by_{le, be} attributes.
> 
> Pls add me to Cc next time.
Ok.

> Why is this change needed? __counted_by_{le, be}() aren't used anywhere
> in the uAPI headers.

The goal of this commit is to be able to accept this another one [1].
In the "batman-adv" we annotate "struct batadv_tvlv_tt_data" with the
"__counted_by_be()" attribute.

[1] https://lore.kernel.org/linux-hardening/AS8PR02MB72371F89D188B047410B755E8B192@AS8PR02MB7237.eurprd02.prod.outlook.com/

Thanks,
Erick

> 
> > 
> > Signed-off-by: Erick Archer <erick.archer@outlook.com>
> > ---
> >  include/uapi/linux/stddef.h | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/include/uapi/linux/stddef.h b/include/uapi/linux/stddef.h
> > index 2ec6f35cda32..58154117d9b0 100644
> > --- a/include/uapi/linux/stddef.h
> > +++ b/include/uapi/linux/stddef.h
> > @@ -55,4 +55,12 @@
> >  #define __counted_by(m)
> >  #endif
> >  
> > +#ifndef __counted_by_le
> > +#define __counted_by_le(m)
> > +#endif
> > +
> > +#ifndef __counted_by_be
> > +#define __counted_by_be(m)
> > +#endif
> > +
> >  #endif /* _UAPI_LINUX_STDDEF_H */
> 
> Thanks,
> Olek

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-11 11:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-06 17:42 [PATCH] uapi: stddef.h: Provide UAPI macros for __counted_by_{le, be} Erick Archer
2024-05-06 17:48 ` Miguel Ojeda
2024-05-07 12:58 ` Alexander Lobakin
2024-05-11 11:04   ` Erick Archer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.