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: <ddf945c3-8bb8-4f20-b53b-5cbf6579a1da@collabora.com>
Date: Mon, 18 Nov 2024 07:52:38 +0100
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
To: Kees Cook <kees@...nel.org>, Lorenzo Bianconi <lorenzo@...nel.org>
Cc: Sean Wang <sean.wang@...nel.org>, Linus Walleij
 <linus.walleij@...aro.org>, linux-mediatek@...ts.infradead.org,
 linux-gpio@...r.kernel.org, Matthias Brugger <matthias.bgg@...il.com>,
 linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
 linux-hardening@...r.kernel.org
Subject: Re: [PATCH] pinctrl: airoha: Use unsigned long for bit search

Il 17/11/24 12:45, Kees Cook ha scritto:
> Instead of risking alignment problems and causing (false positive) array
> bound warnings when casting a u32 to (64-bit) unsigned long, just use a
> native unsigned long for doing bit searches. Avoids warning with GCC 15's
> -Warray-bounds -fdiagnostics-details:
> 
> In file included from ../include/linux/bitmap.h:11,
>                   from ../include/linux/cpumask.h:12,
>                   from ../arch/x86/include/asm/paravirt.h:21,
>                   from ../arch/x86/include/asm/irqflags.h:80,
>                   from ../include/linux/irqflags.h:18,
>                   from ../include/linux/spinlock.h:59,
>                   from ../include/linux/irq.h:14,
>                   from ../include/linux/irqchip/chained_irq.h:10,
>                   from ../include/linux/gpio/driver.h:8,
>                   from ../drivers/pinctrl/mediatek/pinctrl-airoha.c:11:
> In function 'find_next_bit',
>      inlined from 'airoha_irq_handler' at ../drivers/pinctrl/mediatek/pinctrl-airoha.c:2394:3:
> ../include/linux/find.h:65:23: error: array subscript 'long unsigned int[0]' is partly outside array bounds of 'u32[1]' {aka 'unsigned int[1]'} [-Werror=array-bounds=]
>     65 |                 val = *addr & GENMASK(size - 1, offset);
>        |                       ^~~~~
> ../drivers/pinctrl/mediatek/pinctrl-airoha.c: In function 'airoha_irq_handler':
> ../drivers/pinctrl/mediatek/pinctrl-airoha.c:2387:21: note: object 'status' of size 4
>   2387 |                 u32 status;
>        |                     ^~~~~~
> 
> Signed-off-by: Kees Cook <kees@...nel.org>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ