• Seth Forshee's avatar
    UBUNTU: SAUCE: fuse: Support fuse filesystems outside of init_user_ns · e5f2c764
    Seth Forshee authored
    In order to support mounts from namespaces other than
    init_user_ns, fuse must translate uids and gids to/from the
    userns of the process servicing requests on /dev/fuse. This
    patch does that, with a couple of restrictions on the namespace:
    
     - The userns for the fuse connection is fixed to the namespace
       from which /dev/fuse is opened.
    
     - The namespace must be the same as s_user_ns.
    
    These restrictions simplify the implementation by avoiding the
    need to pass around userns references and by allowing fuse to
    rely on the checks in inode_change_ok for ownership changes.
    Either restriction could be relaxed in the future if needed.
    
    For cuse the namespace used for the connection is also simply
    current_user_ns() at the time /dev/cuse is opened.
    Signed-off-by: default avatarSeth Forshee <seth.forshee@canonical.com>
    Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
    e5f2c764
dev.c 52.6 KB