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]
Date:   Thu, 27 Apr 2023 14:13:44 +0800
From:   Yan Wang <rk.code@...look.com>
To:     andy.shevchenko@...il.com
Cc:     linus.walleij@...aro.org, brgl@...ev.pl,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] gpio: gpiolib: clear the array_info's memory space



On 4/26/2023 10:42 PM, andy.shevchenko@...il.com wrote:
> Sun, Apr 23, 2023 at 09:59:43PM +0800, Yan Wang kirjoitti:
>> if hardware number different to array index,it needs to clear to points
>> memory space if the array_info have been assigned a value.
> Can you explain a bit more what's going on there?
>
> ...
Hi Andy,

I use gpiod_get_array() to get a gpio array form the node of DTS.

the node is as follows:
...
gpios = <&gpio1 0 0>, <&gpio1 10 0>;
...
first scan 0 pin of gpio1, its index and hardware number are 0,
the (descs->ndescs == 0 && gpio_chip_hwgpio(desc) == 0) is true and 
descs->info = array_info. then scan 10 pin , its index is 1 ,but 
hardware number is 10 , the  (gpio_chip_hwgpio(desc) != descs->ndescs) 
is true. array_info = NULL, Just make array_info point to NULL, Did't 
clean descs->info memory or point it to NULL. Should the array_info 
point to memory be cleared ? if not cleared ,I use 
gpiod_set_array_value_cansleep() setting pin 10 of gpio1 is invalid. I 
found that the set_mask and get_mask vlaues of descs->info are seted 
0x03 in gpiod_get_array(), I think 0x401 is their correct value. Thank 
you review
>>   			if (bitmap_full(array_info->get_mask, descs->ndescs)) {
>> +				/*clear descs->info*/
>> +				memset(array_info, 0, sizeof(struct gpio_array));
>>   				array_info = NULL;
> ...
>
>>   			}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ