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] [day] [month] [year] [list]
Message-ID: <CACRpkdYvViBkjsvtPuhujpDGi6Z3CMmv8Z8-Vb_y8Xcs=XVOnw@mail.gmail.com>
Date:	Sat, 18 Jun 2016 10:44:22 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Jon Hunter <jonathanh@...dia.com>
Cc:	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V2] pinctrl: Don't create a pinctrl handle if no pinctrl
 entries exist

On Thu, Jun 16, 2016 at 5:27 PM, Jon Hunter <jonathanh@...dia.com> wrote:

> When pinctrl_get() is called for a device, it will return a valid handle
> even if the device itself has no pinctrl state entries defined in
> device-tree. This is caused by the function pinctrl_dt_to_map() which
> will return success even if the first pinctrl state, 'pinctrl-0', is not
> found in the device-tree node for a device.
>
> According to the pinctrl device-tree binding documentation, pinctrl
> states must be numbered starting from 0 and so 'pinctrl-0' should always
> be present if a device uses pinctrl and therefore, if 'pinctrl-0' is not
> present it seems valid that we should not return a valid pinctrl handle.
>
> Fix this by returning an error code if the property 'pinctrl-0' is not
> present for a device.
>
> Signed-off-by: Jon Hunter <jonathanh@...dia.com>

Patch applied (after adding OF to the subject)

It's a bit dangerous because it changes semantics but let's see
if we survive it.

> I was wondering if this meant we are creating pinctrl handles for
> devices on boot that don't use pinctrl (when
> calling pinctrl_bind_pins()). However, although devm_pinctrl_get()
> does return successful for all devices, the subsequent call to
> pinctrl_lookup_state() (to get the default state) will fail and so
> we will destroy the pinctrl handle afterall.

It's better like this, logically. I'm just worried that there may be
code in the tree that depend on the bind always getting a handle.

Yours,
Linus Walleij

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ