Skip to content
  • NeilBrown's avatar
    NFS/sunrpc: don't use a credential with extra groups. · dc6f55e9
    NeilBrown authored
    
    
    The sunrpc layer keeps a cache of recently used credentials and
    'unx_match' is used to find the credential which matches the current
    process.
    
    However unx_match allows a match when the cached credential has extra
    groups at the end of uc_gids list which are not in the process group list.
    
    So if a process with a list of (say) 4 group accesses a file and gains
    access because of the last group in the list, then another process
    with the same uid and gid, and a gid list being the first tree of the
    gids of the original process tries to access the file, it will be
    granted access even though it shouldn't as the wrong rpc credential
    will be used.
    
    Signed-off-by: default avatarNeilBrown <neilb@suse.de>
    Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
    Cc: stable@vger.kernel.org
    dc6f55e9