• Seth Forshee's avatar
    fuse: Add support for pid namespaces · 721a859a
    Seth Forshee authored
    When the userspace process servicing fuse requests is running in
    a pid namespace then pids passed via the fuse fd are not being
    translated into that process' namespace. Translation is necessary
    for the pid to be useful to that process.
    
    Since no use case currently exists for changing namespaces all
    translations can be done relative to the pid namespace in use
    when fuse_conn_init() is called. For fuse this translates to
    mount time, and for cuse this is when /dev/cuse is opened. IO for
    this connection from another namespace will return errors.
    
    Requests from processes whose pid cannot be translated into the
    target namespace are not permitted, except for requests
    allocated via fuse_get_req_nofail_nopages. For no-fail requests
    in.h.pid will be 0 if the pid translation fails.
    
    File locking changes based on previous work done by Eric
    Biederman.
    Signed-off-by: default avatarSeth Forshee <seth.forshee@canonical.com>
    Acked-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
    721a859a
dev.c 52.3 KB