Received: by 10.223.164.221 with SMTP id h29csp3046711wrb; Tue, 3 Oct 2017 16:09:14 -0700 (PDT) X-Received: by 10.98.101.4 with SMTP id z4mr18488971pfb.6.1507072154772; Tue, 03 Oct 2017 16:09:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507072154; cv=none; d=google.com; s=arc-20160816; b=Yy0JcBTPMRbZlvnO1IEm6rtH5fLQewN2PXPzd7loSJyVL4UXx5CrLlHvBLUrXffkZp /sPTKrGcqoyLDbfNHAiVv6X/MHzKqP2idMeA1n5zxjPaqGm0sTQM26VdFrOcqSiC+91o JEnPSAvXaC3my2+wXaQEkiOuZUW9sPz31ScboE8IzARid7azugTRxdqrS0xRMiWpDCkY Twd6FYnNTxmoks0XcUzu/PTGNzclDcgVjsydM+XDfaKc5g4yBOiz2Uo/MMis+Lw1Vl95 16nvFlU2DoZ7fE+BAf4M5PUm2E+/tC3SIqbh7wyaNEkr1QiMkyLmRRv2T2Z+JZ/DvX/q RyCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=fdGO41m/vC0U2jf+2BjdePBW81yrjMEQHN6MFVq1nkk=; b=h5N7O7BQLHYkdJlTAzLfGz941jx4975aqqlejsn5/6Q+H12V4OpBAzEiz/p1glaUkn 7YJ4MhcHewSS+nXkXpqu/Ridf2bts0cIogHBvSvUZBWx2WZ7KUa8KOsvX1Hrh5B+umsE TdwqsckF8TQnI1FVzMkCk5jzyCLcKefl0GX17bviGrHzKM9rGORuNtxKwFqc4dx43zHX mJeYrwMqCGirnAmAaqcj+P8nw84Lq4EEb0F9TLP8v0e0auwOfPSSfqkrd4LVdC9kWKua jPLgvWOrBhH0X4glBacM5UMBEl1q2r6TzdZrhZjn7RwFxTAnBQBATOwvM2Dcfr0Dr7Ql wfGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=g7rlBUhn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j17si10449738pfh.254.2017.10.03.16.09.00; Tue, 03 Oct 2017 16:09:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=g7rlBUhn; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751354AbdJCXIf (ORCPT + 99 others); Tue, 3 Oct 2017 19:08:35 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:54072 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751148AbdJCXId (ORCPT ); Tue, 3 Oct 2017 19:08:33 -0400 Received: by mail-pf0-f171.google.com with SMTP id y24so2072413pfa.10 for ; Tue, 03 Oct 2017 16:08:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fdGO41m/vC0U2jf+2BjdePBW81yrjMEQHN6MFVq1nkk=; b=g7rlBUhnoIRCMMd+FvdmIQ6ggsReG8lEaoOyJ+K13MFA7tZqmDYmjAZZOVBoY1OVFc G81QzlQPdhm+sVGWFBj1UQU7Ksl9gB3D2eB5feCWUH94eUMCVmZR6bFqkOzhvHLD5tNg Oajie62s8TevNe5FKpMrD9TVj2ulVyuWWvdDjVCj2wkIuoGRvs+59GpN6QxTAwtxbpVf GxVILLIvyi/miaE/LGTMNBDfx6quBGX3x/TYzvzLaHt/9+8ZLEeTLcEgD8pne81YfWIh Um0yuUu1ptmDQnhm7rzyktyZRCSZyN57yASYQe9tdLwC0UJ8P79ZBt4iYWY/py0jCjjv lGAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=fdGO41m/vC0U2jf+2BjdePBW81yrjMEQHN6MFVq1nkk=; b=DlTAzW6JOqfj6zmM30oW60nbDc3NWiPJZQyjI78vlTqDUOXoXGpn9++UJCIiwespnZ Yio2xkl6NGclQh10qZZ3cSAKQsM3IBHHiKpAvWVJ0zYQovcOBiYNHaeLW8HzYmN+c3+r Up1RKHyUq2k1mHNQGfremp6jpK4zk5PUsDnuqjNRd957ia89oG7qdcRRXzbaPv7n8/+X TwgpHdxT29j6Lu8XCDLJlmTc9xXCm8NuiOLTLiKBUq2sxwIs8Exn6jNdozL1965tLkcP EUE5EaSimxAHxUZENk5LusLopHAG9gnUR7xRJNktsfaIYpf62a8lcwR09KLmuCJTInQM /QkQ== X-Gm-Message-State: AMCzsaVXy2LO2FhJcKZQrfzMEksg1uv1HGH6y6aJFZURqrkiqJ6Dx/9v d6SYyH35tDs03fLI0Wau56gYpQ== X-Google-Smtp-Source: AOwi7QCRaQY44LUpFxLoSJZfg/hmGfxjg0AJeF/cJVhtypJzaXYe8+2hk0npAAjIjE1scUi2Iogk6Q== X-Received: by 10.84.215.216 with SMTP id g24mr8608714plj.44.1507072112644; Tue, 03 Oct 2017 16:08:32 -0700 (PDT) Received: from localhost ([2620:0:1000:1612:b0bf:67b9:4bfc:f8aa]) by smtp.gmail.com with ESMTPSA id g68sm24476774pfk.136.2017.10.03.16.08.31 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 03 Oct 2017 16:08:31 -0700 (PDT) Date: Tue, 3 Oct 2017 16:08:30 -0700 From: Sandeep Patil To: Laura Abbott Cc: Mark Brown , devel@driverdev.osuosl.org, gregkh@linuxfoundation.org, arve@android.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, riandrews@android.com, Benjamin Gaignard , linux-api@vger.kernel.org, sumit.semwal@linaro.org, dan.carpenter@oracle.com Subject: Re: [PATCH v5 2/2] staging: ion: create one device entry per heap Message-ID: <20171003230830.GA132839@sspatil-desktop.mtv.corp.google.com> References: <1506518409-16887-1-git-send-email-benjamin.gaignard@linaro.org> <1506518409-16887-3-git-send-email-benjamin.gaignard@linaro.org> <2e15edc2-a17f-3930-7d5b-4b5b7d2e0a4d@redhat.com> <20171003164849.rcdgez6lbpmq5llt@sirena.org.uk> <2417c969-357f-d5d9-153a-2180d09b0dc6@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2417c969-357f-d5d9-153a-2180d09b0dc6@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 03, 2017 at 02:42:32PM -0700, Laura Abbott wrote: > On 10/03/2017 09:48 AM, Mark Brown wrote: > > On Mon, Oct 02, 2017 at 11:07:48AM -0700, Laura Abbott wrote: > > > >> Thinking about this a bit more, I'm not 100% sure if this > >> will allow the security rules we want. Heap ids are assigned > >> dynamically and therefore so will the /dev/ionX designation. > >> From my understanding, security rules like selinux need to > >> be fully specified at boot time so I'm not sure how you would > >> be able to write rules to differentiate between /dev/ionX and > >> /dev/ionY without knowing the values at boottime. > > > > Isn't this something that should be managable via udev rules that ensure > > stable names in the same way as for things like disks or ethernet > > controllers (even if it just ends up doing something like /dev/ion-gpu > > or whatever)? If we're not giving it enough information to assign stable > > names where needed we probably need to fix that anyway. > > > > Android doesn't use a standard udev so we'd need something that > would work there. My understanding was that android needs everything > specified at boot unless that's changed. > > There would be enough information to assign stable names > (e.g. /dev/ion-system) if we used the query ioctl to find out > what's actually available. Is just the ioctl useful though? Wouldn't this new ioctl() to query the heap name also result in special case handling of all ion devices in user space? If the devices are named with their corresponding heap names like ion-system, ion-cma etc. It is entirely possible and easy in android/ueventd to create those nodes under "/dev/ion/". (assuming the heap 'subsystem' for these new devices will point to 'ion'). Something like the following should work if added in ueventd.rc subsystem ion devname uevent_devname dirname /dev/ion Also, makes SElinux labelling easier. (Also FWIW, the SELinux permissions are also possible with the current ion implementation by adding rules to disallow specific ioctls instead of adding permissions to access device node as this change would do) - ssp > > Thanks, > Laura > _______________________________________________ > devel mailing list > devel@linuxdriverproject.org > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel From 1580274277811379759@xxx Tue Oct 03 21:43:11 +0000 2017 X-GM-THRID: 1579699119100728687 X-Gmail-Labels: Inbox,Category Forums