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: <eeed3984-3ad2-01c3-365e-443ab664bda2@linaro.org>
Date:   Sat, 28 Jan 2023 11:39:30 +0100
From:   Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
To:     Kees Cook <keescook@...omium.org>
Cc:     Liam Girdwood <lgirdwood@...il.com>,
        Mark Brown <broonie@...nel.org>,
        linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-hardening@...r.kernel.org
Subject: Re: [PATCH] regulator: s5m8767: Bounds check id indexing into arrays

On 28/01/2023 01:53, Kees Cook wrote:
> The compiler has no way to know if "id" is within the array bounds of

It has. For the CONFIG_OF (the only way parent device - sec-core.c - can
match now), the id is assigned in s5m8767_pmic_dt_parse_pdata() and kept
within limits <0,ARRAY_SIZE(regulators)-1>.

The device cannot match via old non-OF way, so there is no real bug to
fix. You are silencing compiler warning, which is fine, but it's not a
real case. The code is not easy to follow, so I am fine with such checks
(WARN_ON_ONCE). The BUILD_BUG_ON is indeed meaningful.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>


Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ