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:   Sun, 23 Apr 2023 21:59:43 +0800
From:   Yan Wang <rk.code@...look.com>
To:     linus.walleij@...aro.org, brgl@...ev.pl
Cc:     Yan Wang <rk.code@...look.com>,
        linux-gpio@...r.kernel.org (open list:GPIO SUBSYSTEM),
        linux-kernel@...r.kernel.org (open list)
Subject: [PATCH v2] gpio: gpiolib: clear the array_info's memory space

if hardware number different to array index,it needs to clear to points
memory space if the array_info have been assigned a value.

Reported-by: kernel test robot <lkp@...el.com>
Link: https://lore.kernel.org/oe-kbuild-all/202304232146.7M89pwCz-lkp@intel.com/
Signed-off-by: Yan Wang <rk.code@...look.com>
---
v1->v2: fixed building warning
---
 drivers/gpio/gpiolib.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 04fb05df805b..8b2a8db44b54 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -4359,6 +4359,8 @@ struct gpio_descs *__must_check gpiod_get_array(struct device *dev,
 			 * hardware number is different from its array index.
 			 */
 			if (bitmap_full(array_info->get_mask, descs->ndescs)) {
+				/*clear descs->info*/
+				memset(array_info, 0, sizeof(struct gpio_array));
 				array_info = NULL;
 			} else {
 				__clear_bit(descs->ndescs,
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ