Re: [PATCH 2/3] compiler.h: Introduce __must_be_char_array()

2025-02-07 Thread Kent Overstreet
On Thu, Feb 06, 2025 at 10:11:29AM -0800, Kees Cook wrote: > In preparation for adding stricter type checking to the str/mem*() > helpers, provide a way to check that a variable is a character array > via __must_be_char_array(). > > Signed-off-by: Kees Cook > --- > include/linux/compiler.h | 8 +

Re: [PATCH 2/3] compiler.h: Introduce __must_be_char_array()

2025-02-07 Thread David Laight
On Fri, 07 Feb 2025 09:55:00 +0100 Rasmus Villemoes wrote: > On Thu, Feb 06 2025, Kees Cook wrote: > > > In preparation for adding stricter type checking to the str/mem*() > > helpers, provide a way to check that a variable is a character array > > via __must_be_char_array(). > > > > Signed-off

Re: [PATCH 2/3] compiler.h: Introduce __must_be_char_array()

2025-02-07 Thread Rasmus Villemoes
On Thu, Feb 06 2025, Kees Cook wrote: > In preparation for adding stricter type checking to the str/mem*() > helpers, provide a way to check that a variable is a character array > via __must_be_char_array(). > > Signed-off-by: Kees Cook > --- > include/linux/compiler.h | 8 +++- > 1 file ch

Re: [PATCH 2/3] compiler.h: Introduce __must_be_char_array()

2025-02-06 Thread Kees Cook
On Thu, Feb 06, 2025 at 07:56:58PM +, David Laight wrote: > On Thu, 6 Feb 2025 10:11:29 -0800 > Kees Cook wrote: > > > In preparation for adding stricter type checking to the str/mem*() > > helpers, provide a way to check that a variable is a character array > > via __must_be_char_array(). >

Re: [PATCH 2/3] compiler.h: Introduce __must_be_char_array()

2025-02-06 Thread Kees Cook
On Thu, Feb 06, 2025 at 03:50:47PM -0500, Kent Overstreet wrote: > On Thu, Feb 06, 2025 at 10:11:29AM -0800, Kees Cook wrote: > > In preparation for adding stricter type checking to the str/mem*() > > helpers, provide a way to check that a variable is a character array > > via __must_be_char_array(

Re: [PATCH 2/3] compiler.h: Introduce __must_be_char_array()

2025-02-06 Thread Kent Overstreet
On Thu, Feb 06, 2025 at 10:11:29AM -0800, Kees Cook wrote: > In preparation for adding stricter type checking to the str/mem*() > helpers, provide a way to check that a variable is a character array > via __must_be_char_array(). > > Signed-off-by: Kees Cook Suggested-by? :) > --- > include/lin

Re: [PATCH 2/3] compiler.h: Introduce __must_be_char_array()

2025-02-06 Thread David Laight
On Thu, 6 Feb 2025 10:11:29 -0800 Kees Cook wrote: > In preparation for adding stricter type checking to the str/mem*() > helpers, provide a way to check that a variable is a character array > via __must_be_char_array(). > ... > +#define __is_char_array(a) (__is_array(a) && sizeof((a)[0]) ==