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] [thread-next>] [day] [month] [year] [list]
Message-ID: <d4a2c0c5-79e4-27bd-2ba4-ba3d10d15a4d@redhat.com>
Date:   Tue, 3 Oct 2017 16:37:58 -0700
From:   Laura Abbott <labbott@...hat.com>
To:     Sandeep Patil <sspatil@...gle.com>
Cc:     Mark Brown <broonie@...nel.org>, devel@...verdev.osuosl.org,
        gregkh@...uxfoundation.org, arve@...roid.com,
        dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
        riandrews@...roid.com,
        Benjamin Gaignard <benjamin.gaignard@...aro.org>,
        linux-api@...r.kernel.org, sumit.semwal@...aro.org,
        dan.carpenter@...cle.com
Subject: Re: [PATCH v5 2/2] staging: ion: create one device entry per heap

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ