Re: [PATCH 2/2] s390/fpu: make use of __uninitialized macro

From: Kees Cook
Date: Mon Feb 05 2024 - 12:00:40 EST


On Mon, Feb 05, 2024 at 05:35:29PM +0100, Heiko Carstens wrote:
> On Mon, Feb 05, 2024 at 08:26:32AM -0800, Kees Cook wrote:
> > > +#define DECLARE_KERNEL_FPU_ONSTACK(name) \
> > > + struct kernel_fpu name __uninitialized
> >
> > Are there cases when struct kernel_fpu should be initialized? e.g.
> > should the attribute just be added to the struct definition instead of
> > marking each use?
>
> I tried that, but failed:
>
> ./arch/s390/include/asm/fpu/types.h:36:3: warning: '__uninitialized__' attribute only applies to local variables [-Wignored-attributes]
> 36 | } __uninitialized;
> | ^

Oh. That's extremely disappointing. I think we may want to consider
opening bug reports with GCC and Clang for this. Not that it'll help us
now, since it needs to actually work today. Bummer!

In that case:

Reviewed-by: Kees Cook <keescook@xxxxxxxxxxxx>

--
Kees Cook