• Eric W. Biederman's avatar
    fuse: Fail all requests with invalid uids or gids · c9582eb0
    Eric W. Biederman authored
    Upon a cursory examinination the uid and gid of a fuse request are
    necessary for correct operation.  Failing a fuse request where those
    values are not reliable seems a straight forward and reliable means of
    ensuring that fuse requests with bad data are not sent or processed.
    
    In most cases the vfs will avoid actions it suspects will cause
    an inode write back of an inode with an invalid uid or gid.  But that does
    not map precisely to what fuse is doing, so test for this and solve
    this at the fuse level as well.
    
    Performing this work in fuse_req_init_context is cheap as the code is
    already performing the translation here and only needs to check the
    result of the translation to see if things are not representable in
    a form the fuse server can handle.
    
    [SzM] Don't zero the context for the nofail case, just keep using the
    munging version (makes sense for debugging and doesn't hurt).
    Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
    Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
    c9582eb0
dev.c 51.5 KB