Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751867AbcL1NII (ORCPT ); Wed, 28 Dec 2016 08:08:08 -0500 Received: from mail-qk0-f176.google.com ([209.85.220.176]:36360 "EHLO mail-qk0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751628AbcL1NIG (ORCPT ); Wed, 28 Dec 2016 08:08:06 -0500 MIME-Version: 1.0 In-Reply-To: <9609b56b-194c-9899-1142-ff2ee285c6bd@metafoo.de> References: <1480432969-20913-1-git-send-email-bgolaszewski@baylibre.com> <44cce3d5-f65e-1a35-20a4-5eb9fda42312@metafoo.de> <9609b56b-194c-9899-1142-ff2ee285c6bd@metafoo.de> From: Linus Walleij Date: Wed, 28 Dec 2016 14:08:04 +0100 Message-ID: Subject: Re: [PATCH] iio: misc: add a generic regulator driver To: Lars-Peter Clausen Cc: Geert Uytterhoeven , Bartosz Golaszewski , Jonathan Cameron , Hartmut Knaack , Peter Meerwald-Stadler , Rob Herring , Mark Rutland , "linux-iio@vger.kernel.org" , linux-devicetree , LKML , Kevin Hilman , Patrick Titiano , Neil Armstrong , Liam Girdwood , Mark Brown Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1423 Lines: 37 On Fri, Dec 23, 2016 at 12:35 PM, Lars-Peter Clausen wrote: > On 12/23/2016 11:00 AM, Geert Uytterhoeven wrote: > Well, it is a policy question. Who gets access to what. Right now it is all > or nothing, a privileged application gets access to all devices/GPIOs, a > unprivileged application gets access to nothing. Same for GPIOs as well as > IIO devices. > > iiod at the moment does not have any access control at all, which in itself > is a problem. We need to add support for that at some point. I don't see an > issue with implementing a finer grained access scheme when we do so. E.g. > unprivileged applications only get access to certain pins. I don't know why this is percieved as such a big practical problem. It seems to me as more of a theoretical exploit path than a practical one. (Famous last words...) We have per-device and not per-line GPIO access restrictions. /dev/gpiochip0 /dev/gpiochip1 etc can all have per-device access restrictions. This is no different from /dev/sda for example. You do not have per-sector control of the block device, because it doesn't make sense. Either you access all of the device, or nothing. The same goes for IIO devices. This pattern is very clear. You get access to a whole device or none of it. As with disks and IIO devices, if you want more granular access restrictions, that is policy, and should reside in userspace. Yours, Linus Walleij