linux-hardening.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@linaro.org>
To: Kees Cook <keescook@chromium.org>
Cc: ci_notify@linaro.org,
	Lists linaro-kernel <linaro-kernel@lists.linaro.org>,
	linux-hardening@vger.kernel.org
Subject: Re: [TCWG CI] Regression caused by linux: Makefile: Enable -Warray-bounds
Date: Tue, 1 Feb 2022 08:17:50 +0100	[thread overview]
Message-ID: <CAK8P3a1CT+-3J7Ufv9TQwRiV4i_+FF=-+phwSjWafyGuPfG+AA@mail.gmail.com> (raw)
In-Reply-To: <202201311410.EA1999F5@keescook>

On Mon, Jan 31, 2022 at 11:30 PM Kees Cook <keescook@chromium.org> wrote:
> On Sun, Jan 30, 2022 at 01:00:43AM +0000, ci_notify@linaro.org wrote:
>
> For example, extracting from the build log, I can see more:
>
> > 00:00:53 In file included from ./include/linux/io.h:13,
> > 00:00:53                  from arch/arm/mach-cns3xxx/pm.c:8:
> > 00:00:53 In function ‘__raw_readl’,
> > 00:00:53     inlined from ‘cns3xxx_pwr_clk_en’ at arch/arm/mach-cns3xxx/pm.c:17:12:
> > 00:00:53 ./arch/arm/include/asm/io.h:113:9: error: array subscript 0 is outside array bounds of ‘const volatile void[0]’ [-Werror=array-bounds]
> > 00:00:53   113 |         asm volatile("ldr %0, %1"
> > 00:00:53       |         ^~~
>
> Looks like something sees a "void" type... this smells like a compiler
> bug. I haven't been able to reproduce this warning yet.

I suspect this is a variation of
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578

When gcc sees a pointer dereference of a literal address like *(int
*)(void *)0x1234000,
this is sometimes interpreted as a NULL pointer with an offset, which
in turn is
assumed to have zero bytes that can be dereferenced.

        Arnd

  reply	other threads:[~2022-02-01  7:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <809699127.18214.1643504444637@jenkins.jenkins>
2022-01-31 22:30 ` [TCWG CI] Regression caused by linux: Makefile: Enable -Warray-bounds Kees Cook
2022-02-01  7:17   ` Arnd Bergmann [this message]
2022-02-01  7:52     ` Kees Cook
2022-02-01  9:03       ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAK8P3a1CT+-3J7Ufv9TQwRiV4i_+FF=-+phwSjWafyGuPfG+AA@mail.gmail.com' \
    --to=arnd@linaro.org \
    --cc=ci_notify@linaro.org \
    --cc=keescook@chromium.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-hardening@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).