Re: [PATCH] sh: machvec: Use char[] for section boundaries

From: Kees Cook
Date: Tue Sep 13 2022 - 14:21:16 EST


On Thu, Sep 08, 2022 at 06:15:39PM -0400, Rich Felker wrote:
> On Wed, Sep 07, 2022 at 04:43:45PM -0700, Kees Cook wrote:
> > As done for other sections, define the extern as a character array,
> > which relaxes many of the compiler-time object size checks, which would
> > otherwise assume it's a single long. Solves the following build error:
> >
> > arch/sh/kernel/machvec.c: error: array subscript 'struct sh_machine_vector[0]' is partly outside array bounds of 'long int[1]' [-Werror=array-bounds]: => 105:33
>
> LGMT. This is the approach I recommend for this general type of
> mechanism. So,
>
> Acked-by: Rich Felker <dalias@xxxxxxxx>
>
> Since I haven't been on top of collating patches for upstreaming, I'd
> be happy if anyone else wants to take this in their tree before I get
> back to it.

Great; thanks! I'll take it via my tree. :)

-Kees

--
Kees Cook