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: <CAMRc=Mc6Tn9CZJA6EN_a0i=hiiz6jTr9oYLHdJ8iyrtsw+LmZw@mail.gmail.com>
Date: Tue, 11 Mar 2025 10:40:13 -0700
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Genes Lists <lists@...ience.com>
Cc: Linus Walleij <linus.walleij@...aro.org>, Bartosz Golaszewski <brgl@...ev.pl>, linux-gpio@...r.kernel.org, 
	linux-kernel@...r.kernel.org
Subject: Re: rc4 and later log message: gpiochip_add_data_with_key:
 get_direction failed

On Tue, 11 Mar 2025 15:03:59 +0100, Genes Lists <lists@...ience.com> said:
> On Sat, 2025-03-08 at 15:45 -0500, Genes Lists wrote:
>> ...
>>
>> there are now 194 lines logged on boot with:
>>
>>  gpio gpiochip0: gpiochip_add_data_with_key: get_direction failed: -
>> 22
>>
>
>
> For completeness - same log noise with rc5 and through commit
> 4d872d51bc9d7b899c1f61534e3dbde72613f627.
>
>
> --
> Gene
>
>

Hi Gene!

There are two problems here. The issue you're seeing is fixed in next but
not in mainline due to my omission. I will send a patch for that.

On the other hand, the pinctrl driver in question should be fixed too.
Can you try the following change:

diff --git a/drivers/pinctrl/intel/pinctrl-intel.c
b/drivers/pinctrl/intel/pinctrl-intel.c
index d889c7c878e2..0c6925b53d9f 100644
--- a/drivers/pinctrl/intel/pinctrl-intel.c
+++ b/drivers/pinctrl/intel/pinctrl-intel.c
@@ -1068,7 +1068,11 @@ static int intel_gpio_get_direction(struct
gpio_chip *chip, unsigned int offset)

        pin = intel_gpio_to_pin(pctrl, offset, NULL, NULL);
        if (pin < 0)
-               return -EINVAL;
+               /*
+                * For pins configured to functions other than GPIO, default
+                * to the safe INPUT value.
+                */
+               return GPIO_LINE_DIRECTION_IN;

        reg = intel_get_padcfg(pctrl, pin, PADCFG0);
        if (!reg)

?

FYI: This was uncovered by commit 9d846b1aebbe ("gpiolib: check the
return value of gpio_chip::get_direction()").

Bart

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ