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>] [day] [month] [year] [list]
Date:   Sat, 30 Jan 2021 11:05:08 +0900
From:   William Breathitt Gray <vilhelm.gray@...il.com>
To:     Srinivas Neeli <srinivas.neeli@...inx.com>
Cc:     linus.walleij@...aro.org, bgolaszewski@...libre.com,
        michal.simek@...inx.com, shubhrajyoti.datta@...inx.com,
        sgoud@...inx.com, syednwaris@...il.com, linux-gpio@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        git@...inx.com
Subject: Re: [PATCH V5 5/5] gpio: gpio-xilinx: Add check if width exceeds 32

On Fri, Jan 29, 2021 at 07:56:50PM +0530, Srinivas Neeli wrote:
> Add check to see if gpio-width property does not exceed 32.
> If it exceeds then return -EINVAL.
> 
> Signed-off-by: Srinivas Neeli <srinivas.neeli@...inx.com>
> Reviewed-by: Linus Walleij <linus.walleij@...aro.org>

Acked-by: William Breathitt Gray <vilhelm.gray@...il.com>

> ---
> Changes in V5:
> -None
> Changes in V4:
> -New patch.
> ---
>  drivers/gpio/gpio-xilinx.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c
> index acd574779ca6..b411d3156e0b 100644
> --- a/drivers/gpio/gpio-xilinx.c
> +++ b/drivers/gpio/gpio-xilinx.c
> @@ -589,6 +589,9 @@ static int xgpio_probe(struct platform_device *pdev)
>  	if (of_property_read_u32(np, "xlnx,gpio-width", &chip->gpio_width[0]))
>  		chip->gpio_width[0] = 32;
>  
> +	if (chip->gpio_width[0] > 32)
> +		return -EINVAL;
> +
>  	spin_lock_init(&chip->gpio_lock);
>  
>  	if (of_property_read_u32(np, "xlnx,is-dual", &is_dual))
> @@ -613,6 +616,8 @@ static int xgpio_probe(struct platform_device *pdev)
>  					 &chip->gpio_width[1]))
>  			chip->gpio_width[1] = 32;
>  
> +		if (chip->gpio_width[1] > 32)
> +			return -EINVAL;
>  	}
>  
>  	chip->gc.base = -1;
> -- 
> 2.7.4
> 

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ