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:   Tue, 08 Sep 2020 16:52:58 -0700
From:   Trent Piepho <tpiepho@...il.com>
To:     linux-arm-kernel@...ts.infradead.org
Cc:     Drew Fustini <drew@...gleboard.org>,
        Tony Lindgren <tony@...mide.com>,
        Rob Herring <robh+dt@...nel.org>, linux-omap@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
        Linus Walleij <linus.walleij@...aro.org>,
        Haojian Zhuang <haojian.zhuang@...aro.org>,
        devicetree@...r.kernel.org, bcousson@...libre.com,
        Jason Kridner <jkridner@...gleboard.org>,
        Robert Nelson <robertcnelson@...il.com>
Subject: Re: [PATCH v4 1/2] pinctrl: single: parse #pinctrl-cells = 2

On Tuesday, June 30, 2020 6:33:19 PM PDT Drew Fustini wrote:
> If "pinctrl-single,pins" has 3 arguments (offset, conf, mux), then
> pcs_parse_one_pinctrl_entry() does an OR operation on conf and mux to
> get the value to store in the register.


> -		vals[found].val = pinctrl_spec.args[1];
> +
> +		switch (pinctrl_spec.args_count) {
> +		case 2:
> +			vals[found].val = pinctrl_spec.args[1];
> +			break;
> +		case 3:
> +			vals[found].val = (pinctrl_spec.args[1] | 
pinctrl_spec.args[2]);
> +			break;
> +		}
> 
>  		dev_dbg(pcs->dev, "%pOFn index: 0x%x value: 0x%x\n",
>  			pinctrl_spec.np, offset, 
pinctrl_spec.args[1]);

If #pinctrl-cells value is greater than 2, nothing will set vals[found].val to 
anything other than zero (from when it's calloc'ed) and the pinctrl will 
silently be programmed to zero.

The debug printout was not change to print vals[found].val, so it will 
continue to print the value of the 2nd cell.

The result is that a #pinctrl-cells of 3 will produce no warning or error, 
program the pinctrl to zero, whilst at the same time emit debug log messages 
that it is programming the expected values.

The device tree documentation still states that #pinctrl-cells must be 1 when 
using pinctrl-single,pins.  This new special case of ORing two values is not 
documented.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ