]> git.karo-electronics.de Git - karo-tx-linux.git/commit
NFS/sunrpc: don't use a credential with extra groups.
authorNeilBrown <neilb@suse.de>
Mon, 24 Oct 2011 23:25:49 +0000 (10:25 +1100)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Fri, 17 Aug 2012 19:35:51 +0000 (15:35 -0400)
commit64a211ecd8c813da236aef72eab7e76a8de4592f
tree1fabe433732aaa75659f80ed7f547627679656be
parent649de82fef23a2b5ad04b7765c872f35651358a9
NFS/sunrpc: don't use a credential with extra groups.

commit dc6f55e9f8dac4b6479be67c5c9128ad37bb491f upstream.

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: NeilBrown <neilb@suse.de>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
net/sunrpc/auth_unix.c