• Jeff Sharkey's avatar
    Let's reinvent storage, yet again! · 66270a21
    Jeff Sharkey authored
    Now that we're treating storage as a runtime permission, we need to
    grant read/write access without killing the app.  This is really
    tricky, since we had been using GIDs for access control, and they're
    set in stone once Zygote drops privileges.
    
    The only thing left that can change dynamically is the filesystem
    itself, so let's do that.  This means changing the FUSE daemon to
    present itself as three different views:
    
    /mnt/runtime_default/foo - view for apps with no access
    /mnt/runtime_read/foo - view for apps with read access
    /mnt/runtime_write/foo - view for apps with write access
    
    There is still a single location for all the backing files, and
    filesystem permissions are derived the same way for each view, but
    the file modes are masked off differently for each mountpoint.
    
    During Zygote fork, it wires up the appropriate storage access into
    an isolated mount namespace based on the current app permissions.  When
    the app is granted permissions dynamically at runtime, the sy...
    66270a21
VolumeBase.cpp 6.36 KB