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-next>] [day] [month] [year] [list]
Date:   Wed, 3 Jul 2019 05:35:46 +0000
From:   Chris Packham <Chris.Packham@...iedtelesis.co.nz>
To:     Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <bgolaszewski@...libre.com>
CC:     "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: gpio desc flags being lost

Hi LinusW, Bartosz,

I was debugging something else and I noticed a problem with the gpio 
framework or the gpio-mmio driver (or both) in 5.2.0-rc6.

I have some gpio hogs in my device tree which seem to get requested at 
startup as expected

...
GPIO line 456 (sw-reset) hogged as output/low
GPIO line 459 (phy-1g-reset) hogged as output/low
GPIO line 460 (i2c-reset) hogged as output/low
GPIO line 461 (lm81-reset) hogged as output/low
GPIO line 462 (phy-led-reset) hogged as output/low
GPIO line 448 (pcie-reset) hogged as output/low
..

I wanted to see what state these lines were in

# cat /sys/kernel/debug/gpio
gpiochip4: GPIOs 448-455, parent: platform/fffa00029.dev-reset-ctl-2, 
fffa00029.dev-reset-ctl-2:

gpiochip3: GPIOs 456-463, parent: platform/fffa00020.dev-reset-ctl, 
fffa00020.dev-reset-ctl:

I expected the hogs to show up here.

# echo 448 >/sys/class/gpio/export

Now I'm pretty sure I shouldn't be allowed to do that.

# cat /sys/kernel/debug/gpio
gpiochip4: GPIOs 448-455, parent: platform/fffa00029.dev-reset-ctl-2, 
fffa00029.dev-reset-ctl-2:gpio-448 (                    |sysfs 
     ) in  lo

Doing a bit of debugging so far I see that after startup the desc->flags 
for those gpios is 0. But for the hogged ones it should be 0x800 (or 0x801).

I happen to have a 4.8.17 kernel for the board I'm using. Testing with 
that seems to be OK.

[root@...uxbox ~]# uname -a
Linux linuxbox 4.8.17-at1+ #3 SMP Wed Jul 3 05:30:55 UTC 2019 ppc GNU/Linux
[root@...uxbox ~]# cat /sys/kernel/debug/gpio
gpiochip4: GPIOs 448-455, parent: platform/fffa00029.dev-reset-ctl-2, 
fffa00029.dev-reset-ctl-2:
  gpio-448 (                    |pcie-reset          ) out lo

gpiochip3: GPIOs 456-463, parent: platform/fffa00020.dev-reset-ctl, 
fffa00020.dev-reset-ctl:
  gpio-456 (                    |sw-reset            ) out lo
  gpio-459 (                    |phy-1g-reset        ) out lo
  gpio-460 (                    |i2c-reset           ) out lo
  gpio-461 (                    |lm81-reset          ) out lo
  gpio-462 (                    |phy-led-reset       ) out lo

[root@...uxbox ~]# echo 448 >/sys/class/gpio/export
sh: write error: Device or resource busy

I'll do some proper bisecting tomorrow, but figured you might want to 
know sooner rather than later.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ