lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Wed, 8 Jun 2022 08:54:10 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Mark Rutland <mark.rutland@....com>
Cc:     Arnd Bergmann <arnd@...db.de>,
        Naresh Kamboju <naresh.kamboju@...aro.org>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        open list <linux-kernel@...r.kernel.org>,
        regressions@...ts.linux.dev, lkft-triage@...ts.linaro.org,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        John Donnelly <john.p.donnelly@...cle.com>,
        Huacai Chen <chenhuacai@...nel.org>,
        Bjorn Andersson <bjorn.andersson@...aro.org>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        David Hildenbrand <david@...hat.com>,
        "Guilherme G. Piccoli" <gpiccoli@...lia.com>,
        Zhen Lei <thunder.leizhen@...wei.com>,
        Anshuman Khandual <anshuman.khandual@....com>,
        Kefeng Wang <wangkefeng.wang@...wei.com>
Subject: Re: gcc-12: build errors: arch/arm64/kernel/setup.c:225:56: warning:
 array subscript -1 is outside array bounds of 'char[]' [-Warray-bounds]

On Mon, Jun 6, 2022 at 11:41 AM Mark Rutland <mark.rutland@....com> wrote:
> On Fri, Jun 03, 2022 at 09:40:07AM +0200, Arnd Bergmann wrote:
>
>         #define va_init_begin() RELOC_HIDE((unsigned long)__init_begin)
>
> ... which'd be a pain, but at least it'd solve this generally.
>
> > I think the easy fix would be to reword this line to
> >
> >        kernel_code.end     = __pa_symbol(__init_begin) - 1;
> >
>
> I agree that'd work for the __pa_symbol() cases.
>
> For consistency it might be worth using RELOC_HIDE(), e.g.
>
>         kernel_code.end     = __pa_symbol(RELOC_HIDE(__init_begin)) - 1);
>asm-gener
> ... which IIUC should do the trick.
>

I see we have similar logic on each architecture, and they probably
all have the same
issue now, so maybe we can just do a helper function in include/linux/ioport.h
(which has all the struct resource logic) that can be called like

resource_set_pa(&kernel_code, _stext, __init_begin);
resource_set_pa(&kernel_data, _sdata, _end);

      Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ