Re: [PATCH] regulator: s5m8767: Bounds check id indexing into arrays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>


Best regards,
Krzysztof




[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux for Synopsys ARC Processors]    
  • [Linux on Unisoc (RDA Micro) SoCs]     [Linux Actions SoC]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  •   Powered by Linux