]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
r228827 fixed a problem where copying of NFSv4 open credentials into
authorRick Macklem <rmacklem@FreeBSD.org>
Tue, 7 Feb 2012 16:32:43 +0000 (16:32 +0000)
committerRick Macklem <rmacklem@FreeBSD.org>
Tue, 7 Feb 2012 16:32:43 +0000 (16:32 +0000)
commit8c9c322347b6e5966e798dc920c4a8e4095d0133
treeeeb525fca9a6c7b06b69abcafc731e60f50e0296
parent50c8ec53f6bd1f8ae9b46045179b6a63a2343836
r228827 fixed a problem where copying of NFSv4 open credentials into
a credential structure would corrupt it. This happened when the
p argument was != NULL. However, I now realize that the copying of
open credentials should only happen for p == NULL, since that indicates
that it is a read-ahead or write-behind. This patch fixes this.
After this commit, r228827 could be reverted, but I think the code is
clearer and safer with the patch, so I am going to leave it in.
Without this patch, it was possible that a NFSv4 VOP_SETATTR() could have
changed the credentials of the caller. This would have happened if
the process doing the VOP_SETATTR() did not have the file open, but
some other process running as a different uid had the file open for writing
at the same time.

MFC after: 5 days
sys/fs/nfsclient/nfs_clstate.c