[Vm-dev] [squeak-dev] File & Socket Handle Access

Bert Freudenberg bert at freudenbergs.de
Wed Aug 16 12:30:14 UTC 2017


On Wed, Aug 16, 2017 at 2:13 PM, Denis Kudriashov <dionisiydk at gmail.com>
wrote:

>
>
> 2017-08-16 13:52 GMT+02:00 Bert Freudenberg <bert at freudenbergs.de>:
>
>>
>> On Wed, Aug 16, 2017 at 1:36 PM, Denis Kudriashov <dionisiydk at gmail.com>
>> wrote:
>>
>>> Hi Eliot.
>>>
>>> I asked David why he didn't add it to the SocketPlugin in the first
>>>> place and he discussed Andreas Rabb's security concerns
>>>
>>>
>>> It would be interesting to read about them because it looks strange that
>>> it is secure to manage OS handle from VM but not secure to manage it from
>>> image side. Both ways are requested by user directly or indirectly which
>>> means that user has OS permissions. So what the difference?
>>>
>>
>> ​It's for when yo​u want to allow arbitrary code to be executed in the
>> image, yet still protect the machine from harm. This happens when sharing
>> objects between images - an object could have malicious code attached. So
>> in that case, before running the code, we turn on the VM file sandbox via
>> the SecurityPlugin. This ensures that the image can only access files in a
>> sandbox directory but not outside. But it only works if the FilePlugin is
>> the only way to access files - meaning FFI and OSProcess etc. must be
>> disabled, and there must not be another way to create file handles.
>>
>
> Thank's Bert. It is clear but I wonder how it can really work. Because if
> you are able turn on/off VM file sandbox during image runtime then how
> system prevents arbitrary code to turn off this security back to perform
> bad actions?
>

​It cannot be turned off once the sandbox is enabled. You will have to
restart the image.​


> And if it is static setting for whole image session then why it is really
> useful? OS security solves all these issues.
>

​10 years ago OS security was really bad. ​Sandboxing applications from
each other only just started to become mainstream back then - the OLPC's
Sugar OS with Ivan Krstić's "bitfrost" was one of the first, Apple iOS and
Android followed, then Mac OS X and Windows. But our VMs still do not use
the OS security capabilities - they usually run with the same privileges as
the user that is logged in, meaning they can read or even delete all the
user's files.

It would be good to make the VM use these modern security features, but I
don't know of any plan to do so (maybe apart from the iOS and Android VMs,
where the system won't even allow to run an old app).

I ask because I have no idea about SecurityPlugin. So maybe you will point
> me to some doc.
>

​I don't know of any docs beyond the SecurityManager class, which has some
comments in its methods. I guess it could use a nice class comment. But in
essence it is very simple - some VM capabilities (namely file access,
socket access, and image write) can be disabled, and there is no way of
re-enabling them.

​- Bert -​
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20170816/46aa104d/attachment.html>


More information about the Vm-dev mailing list