From: Laura Abbott <labbott-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Sandeep Patil <sspatil-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
arve-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
riandrews-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org,
Benjamin Gaignard
<benjamin.gaignard-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
sumit.semwal-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH v5 2/2] staging: ion: create one device entry per heap
Date: Tue, 3 Oct 2017 16:37:58 -0700 [thread overview]
Message-ID: <d4a2c0c5-79e4-27bd-2ba4-ba3d10d15a4d@redhat.com> (raw)
In-Reply-To: <20171003230830.GA132839-MgWQydg8T0mvj1b/ULB3ZwqCisvMvsWYTsK6IJ4gZTFBDgjK7y7TUQ@public.gmane.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
next prev parent reply other threads:[~2017-10-03 23:37 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-27 13:20 [PATCH v5 0/2] staging: ion: get one device per heap Benjamin Gaignard
2017-09-27 13:20 ` [PATCH v5 1/2] staging: ion: simplify ioctl args checking function Benjamin Gaignard
2017-10-09 9:21 ` Benjamin Gaignard
2017-10-09 16:45 ` Laura Abbott
2017-09-27 13:20 ` [PATCH v5 2/2] staging: ion: create one device entry per heap Benjamin Gaignard
[not found] ` <1506518409-16887-3-git-send-email-benjamin.gaignard-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2017-10-02 18:07 ` Laura Abbott
2017-10-03 16:48 ` Mark Brown
2017-10-03 21:42 ` Laura Abbott
[not found] ` <2417c969-357f-d5d9-153a-2180d09b0dc6-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-10-03 23:08 ` Sandeep Patil
[not found] ` <20171003230830.GA132839-MgWQydg8T0mvj1b/ULB3ZwqCisvMvsWYTsK6IJ4gZTFBDgjK7y7TUQ@public.gmane.org>
2017-10-03 23:37 ` Laura Abbott [this message]
2017-10-04 10:17 ` Mark Brown
2017-10-05 13:06 ` Benjamin Gaignard
2017-10-09 21:25 ` Laura Abbott
2017-10-09 22:08 ` Mark Brown
2017-10-10 0:10 ` Laura Abbott
2017-10-10 9:11 ` Mark Brown
2017-10-16 22:09 ` Laura Abbott
[not found] ` <2a9246e0-eafa-7812-6cf4-2482ff1ed158-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-10-17 12:39 ` Benjamin Gaignard
2017-10-18 20:07 ` Laura Abbott
[not found] ` <bff3d0c7-110d-d702-165b-855daaca6382-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2017-10-23 15:19 ` Benjamin Gaignard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d4a2c0c5-79e4-27bd-2ba4-ba3d10d15a4d@redhat.com \
--to=labbott-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=arve-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org \
--cc=benjamin.gaignard-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
--cc=devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=riandrews-z5hGa2qSFaRBDgjK7y7TUQ@public.gmane.org \
--cc=sspatil-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org \
--cc=sumit.semwal-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).