]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC: r334966
authorrmacklem <rmacklem@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 30 Jul 2018 12:17:10 +0000 (12:17 +0000)
committerrmacklem <rmacklem@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Mon, 30 Jul 2018 12:17:10 +0000 (12:17 +0000)
commitbf50bc033b52a606754c628278afcbd80a750fc1
tree65feecdc07d7309ee85cec6cc5cb17d1c2cb48be
parent093c4308a2bb6fbf1836e20bf690c017be3bd246
MFC: r334966
Add a couple of safety belt checks to the NFSv4.1 client related to sessions.

There were a couple of cases in newnfs_request() that it assumed that it
was an NFSv4.1 mount with a session. This should always be the case when
a Sequence operation is in the reply or the server replies NFSERR_BADSESSION.
However, if a server was broken and sent an erroneous reply, these safety
belt checks should avoid trouble.
The one check required a small tweak to nfsmnt_mdssession() so that it
returns NULL when there is no session instead of the offset of the field
in the structure (0x8 for i386).
This patch should have no effect on normal operation of the client.
Found by inspection during pNFS server development.

git-svn-id: svn://svn.freebsd.org/base/stable/10@336899 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/fs/nfs/nfs_commonkrpc.c
sys/fs/nfsclient/nfsmount.h