Received: by 10.223.164.221 with SMTP id h29csp3069312wrb; Tue, 3 Oct 2017 16:39:06 -0700 (PDT) X-Received: by 10.99.126.21 with SMTP id z21mr11356360pgc.113.1507073945965; Tue, 03 Oct 2017 16:39:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507073945; cv=none; d=google.com; s=arc-20160816; b=ZfWJdHp001cBcMgr64F4YisFk7akmMuJ9+gsvALKXO/e5y4RpbTSI/kVt8/cK9g3XG HrSWd6imCGuaM1Z1+cYz0Jo85ys3QUlASHryxtT0+jQHYStj8IfBjBf0w4+Lkpy6BdMb 55QTfOoyW26FEy83Rf69VU2OZ8EKdURJ6xQjcIXAXyCsqAtj1T6KmGAILMR5kJtx/W49 wCjiLmf/WY5NcerbyDDrQc3mv2EQ8JKIoRWr/kNUO7b2+ThVRoWZWGq7kyMh562ySysa OOeOIJQe2W5suNG4vW2MTCMrvYRbsfslgoY+wbaZXsHVT50R68lqw90KUKYyRQBIol13 Vz0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=c5Ooi1Dyj4c/9Frv0uZkIfrkbocqFoNK0OF4ELgCO8c=; b=BwXtyKErnyAcez8Yymw/IIUkZPTjO7oLtD13Dwq3iuzeMQKXPdQuLMWFpAPl9EHy7M 5PljW8SGYXmPq34wMQQC8hSX4n3N+j2Ue5Rvh43LqzDUfSBjJ0e2cNLuIoHhAwoWS3Yh kfpWenBfx8/epthYGwoBZQ7MsjbdMLXcoz80j/MzPXFcRkju2TvvlppGgdJq/1GoAIJ0 8Xo7oM+k6tvIrmWpAvkOcU5553TkxXqUNe8Fq6XhuvNdwxyoTQxErspe/mJwd1hsrkU8 sKwanSetjwS0bcmRPiMEqFidAiTZJU+1cANJEAfKUxOEF3s5Vvj/yoE7eKcmxQoUl2ND uWTQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 127si10554962pfe.378.2017.10.03.16.38.41; Tue, 03 Oct 2017 16:39:05 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751384AbdJCXiF (ORCPT + 99 others); Tue, 3 Oct 2017 19:38:05 -0400 Received: from mail-qt0-f175.google.com ([209.85.216.175]:51821 "EHLO mail-qt0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751267AbdJCXiD (ORCPT ); Tue, 3 Oct 2017 19:38:03 -0400 Received: by mail-qt0-f175.google.com with SMTP id q4so16162667qtq.8 for ; Tue, 03 Oct 2017 16:38:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=c5Ooi1Dyj4c/9Frv0uZkIfrkbocqFoNK0OF4ELgCO8c=; b=SEL9l/UbB+xMIR3saRM+7OFKBoWC7l6Nc70Oav0iSWBEuGoeT1Fz+23Emd75IFlYdi GF6+fHjWKjqPmLFlcw2DB0GtSx59OaU/YndmEelvfF1QkbOvFaFhe+zKCCHmEc6rAFR4 JUAoXN58o6/f30RaPfdRT5V3m/uFwH4GtwnmEUmY9Fw2TlZlGq4SVAWL5wRPQ3HEVdkH JIdGG9U88sxYe1if4NZ3VuH1esGMrlZugGFccDQkR6XuRe7OE7ahAx63vBiARr9D9mKU 3I8r8/5N11WL8E469QLgqwTN5a9tsaUzq8+ucjsOHKMD4GtMkvwdULo0KnY7zP8USt+l Ckcg== X-Gm-Message-State: AMCzsaV4qBMgJUrOjzapSl8Vi6CcuD66G732LmyXnysGBME43aWVy72M ymtRH80NEh0qlFcFzRUXMLc7pw== X-Google-Smtp-Source: AOwi7QDasEwbGE0M0zUZHWMkUk+YwvWNFZGZqZV8bxT5kYgdV5WCuGZaOmaIRueScta5no/RgtBG9A== X-Received: by 10.200.9.115 with SMTP id z48mr17003757qth.141.1507073882284; Tue, 03 Oct 2017 16:38:02 -0700 (PDT) Received: from ?IPv6:2601:602:9802:a8dc::e174? ([2601:602:9802:a8dc::e174]) by smtp.gmail.com with ESMTPSA id v192sm9051244qka.76.2017.10.03.16.37.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Oct 2017 16:38:01 -0700 (PDT) Subject: Re: [PATCH v5 2/2] staging: ion: create one device entry per heap To: Sandeep Patil 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 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> <20171003230830.GA132839@sspatil-desktop.mtv.corp.google.com> From: Laura Abbott Message-ID: Date: Tue, 3 Oct 2017 16:37:58 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171003230830.GA132839@sspatil-desktop.mtv.corp.google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/03/2017 04:08 PM, Sandeep Patil wrote: > 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? > I'm not quite sure what you are referring to. If you mean we have to match on the heap name then yes that's going to happen but we can't just zero knowledge which heap to allocate from and matching on heap names seemed like the easiest way to make that happen. > 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. > That's useful to know, thanks. > (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) > Can selinux disallow access within the ioctls though? The access control wanted is at a heap granularity and disallowing certain ioctls won't fix that. > > - ssp > Thanks, Laura From 1580279691610053903@xxx Tue Oct 03 23:09:14 +0000 2017 X-GM-THRID: 1579699119100728687 X-Gmail-Labels: Inbox,Category Forums