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] [thread-next>] [day] [month] [year] [list]
Message-ID: <202301121452.14D1A95CA@keescook>
Date:   Thu, 12 Jan 2023 14:54:00 -0800
From:   Kees Cook <keescook@...omium.org>
To:     Linus Walleij <linus.walleij@...aro.org>
Cc:     Krzysztof Halasa <khalasa@...p.pl>, Arnd Bergmann <arnd@...db.de>,
        "Gustavo A. R. Silva" <gustavoars@...nel.org>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        linux-hardening@...r.kernel.org
Subject: Re: [PATCH] ARM: ixp4xx: Replace 0-length arrays with flexible arrays

On Sun, Jan 08, 2023 at 12:58:37AM +0100, Linus Walleij wrote:
> On Thu, Jan 5, 2023 at 10:57 PM Kees Cook <keescook@...omium.org> wrote:
> 
> > Zero-length arrays are deprecated[1]. Replace npe_load_firmware's
> > union of 0-length arrays with flexible arrays. Detected with GCC 13,
> > using -fstrict-flex-arrays=3:
> >
> > drivers/soc/ixp4xx/ixp4xx-npe.c: In function 'npe_load_firmware':
> > drivers/soc/ixp4xx/ixp4xx-npe.c:570:60: warning: array subscript i is outside array bounds of 'u32[0]' {aka 'unsigned int[]'} [-Warray-bounds=]
> >   570 |                         image->data[i] = swab32(image->data[i]);
> > include/uapi/linux/swab.h:115:54: note: in definition of macro '__swab32'
> >   115 | #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
> >       |                                                      ^
> > drivers/soc/ixp4xx/ixp4xx-npe.c:570:42: note: in expansion of macro 'swab32'
> >   570 |                         image->data[i] = swab32(image->data[i]);
> >       |                                          ^~~~~~
> > drivers/soc/ixp4xx/ixp4xx-npe.c:522:29: note: while referencing 'data'
> >   522 |                         u32 data[0];
> >       |                             ^~~~
> >
> > [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays
> >
> > Cc: Krzysztof Halasa <khalasa@...p.pl>
> > Cc: Linus Walleij <linus.walleij@...aro.org>
> > Cc: Arnd Bergmann <arnd@...db.de>
> > Cc: "Gustavo A. R. Silva" <gustavoars@...nel.org>
> > Cc: linux-arm-kernel@...ts.infradead.org
> > Signed-off-by: Kees Cook <keescook@...omium.org>
> 
> Looks good to me:
> Reviewed-by: Linus Walleij <linus.walleij@...aro.org>

Thanks!

> Do you need me to funnel this to the SoC tree or do you have
> some quickpath for fixes like this?

I'll take it via my tree if unless you'd rather it go through yours.
Most maintainers take these directly, but some don't want to. I'm
flexible! :)

-- 
Kees Cook

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ