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: <2688812.mvXUDI8C0e@jernej-laptop>
Date:   Wed, 12 Jul 2023 19:53:34 +0200
From:   Jernej Škrabec <jernej.skrabec@...il.com>
To:     Linus Walleij <linus.walleij@...aro.org>,
        Chen-Yu Tsai <wens@...e.org>,
        Samuel Holland <samuel@...lland.org>,
        Mark Brown <broonie@...nel.org>
Cc:     linux-gpio@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-sunxi@...ts.linux.dev, linux-kernel@...r.kernel.org,
        Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH] pinctrl: sunxi: Add some defensiveness for regulators array

Dne sreda, 12. julij 2023 ob 19:19:59 CEST je Mark Brown napisal(a):
> The sunxi pinctrl has a fixed size array it uses to store regulators used
> in the driver. There is currently nothing that ensures that the number of
> elements in the array is large enough to map the regulators defined by the
> individual SoCs. While this is currently the case having an explicit check
> in there will make life easier for anyone debugging memory issues that
> manifest in the driver so let's add one.
> 
> Signed-off-by: Mark Brown <broonie@...nel.org>

Reviewed-by: Jernej Skrabec <jernej.skrabec@...il.com>

Best regards,
Jernej

> ---
>  drivers/pinctrl/sunxi/pinctrl-sunxi.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
> b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index 1dc1882cbdd7..1d1cd3d6d379
> 100644
> --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c
> +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c
> @@ -848,6 +848,9 @@ static int sunxi_pmx_request(struct pinctrl_dev
> *pctldev, unsigned offset) char supply[16];
>  	int ret;
> 
> +	if (WARN_ON_ONCE(bank_offset >= ARRAY_SIZE(pctl->regulators)))
> +		return -EINVAL;
> +
>  	if (reg) {
>  		refcount_inc(&s_reg->refcount);
>  		return 0;
> 
> ---
> base-commit: 06c2afb862f9da8dc5efa4b6076a0e48c3fbaaa5
> change-id: 20230711-pinctrl-sunxi-boudns-95bf5da3d075
> 
> Best regards,




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ