[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAK8P3a36YHAnDyhy+nQEo9x=c2Dq8pf44sBsksXj2xb+Fnk-bA@mail.gmail.com>
Date: Wed, 15 Sep 2021 16:04:22 +0200
From: Arnd Bergmann <arnd@...nel.org>
To: Guenter Roeck <linux@...ck-us.net>
Cc: "David S . Miller" <davem@...emloft.net>,
sparclinux <sparclinux@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
David Laight <David.Laight@...lab.com>,
Anatoly Pugachev <matorola@...il.com>,
Sam Ravnborg <sam@...nborg.org>
Subject: Re: [PATCH v2] sparc: mdesc: Fix compile error seen with gcc 11.x
On Wed, Sep 15, 2021 at 12:47 AM Guenter Roeck <linux@...ck-us.net> wrote:
>
> sparc64 images fail to compile with gcc 11.x, reporting the following
> errors.
>
> arch/sparc/kernel/mdesc.c:647:22: error:
> 'strcmp' reading 1 or more bytes from a region of size 0
> arch/sparc/kernel/mdesc.c:692:22: error:
> 'strcmp' reading 1 or more bytes from a region of size 0
> arch/sparc/kernel/mdesc.c:719:21:
> error: 'strcmp' reading 1 or more bytes from a region of size 0
>
> The underlying problem is that node_block() returns a pointer beyond
> the end of struct mdesc_hdr. gcc 11.x detects that and reports the error.
> Adding an additional zero-length field to struct mdesc_hdr and pointing
> to that field fixes the problem.
>
> Cc: Arnd Bergmann <arnd@...nel.org>
> Cc: David Laight <David.Laight@...LAB.COM>
> Cc: Anatoly Pugachev <matorola@...il.com>
> Cc: Sam Ravnborg <sam@...nborg.org>
> Signed-off-by: Guenter Roeck <linux@...ck-us.net>
> ---
> v2: data[0] => data[]
>
> I am not sure if there was agreement to accept this patch or not, but
> I was asked to resend it with the above change, so here it is. An open
> question was if it is acceptable to have a structure named xxx_hdr
> include an element pointing to the data following that header.
>
Reviewed-by: Arnd Bergmann <arnd@...db.de>
Powered by blists - more mailing lists