]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC: r320208
authorrmacklem <rmacklem@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 7 Jul 2017 21:33:06 +0000 (21:33 +0000)
committerrmacklem <rmacklem@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 7 Jul 2017 21:33:06 +0000 (21:33 +0000)
commitce60d1e6f155543ea1dc58b776990462894f04bb
tree588efb373d525c28226c9b8e0311da81bb951dd1
parentae77d24346f1824dc97d08ccd7710671f25b3b4b
MFC: r320208
Ensure that the credentials field of the NFSv4 client open structure is
initialized.

bdrewery@ has reported panics "newnfs_copycred: negative nfsc_ngroups".
The only way I can see that this occurs is that the credentials field of
the open structure gets used before being filled in.
I am not sure quite how this happens, but for the file create case, the
code is serialized via the vnode lock on the directory. If, somehow, a
link to the same file gets created just after file creation, this might
occur.

This patch ensures that the credentials field is initialized to a reasonable
set of credentials before the structure is linked into any list, so I
this should ensure it is initialized before use.
I am committing the patch now, since bdrewery@ notes that the panics
are intermittent and it may be months before he knows if the patch fixes
his problem.

git-svn-id: svn://svn.freebsd.org/base/stable/10@320795 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/fs/nfsclient/nfs_clstate.c