]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC: r334966
authorrmacklem <rmacklem@FreeBSD.org>
Mon, 30 Jul 2018 12:10:23 +0000 (12:10 +0000)
committerrmacklem <rmacklem@FreeBSD.org>
Mon, 30 Jul 2018 12:10:23 +0000 (12:10 +0000)
commit86d1f22b45319a5ff386fa169812146d4ba829e2
treeed22d49a9aa3693c97ae1abd6c2697fb88f2d708
parentacec37cc01fe99565391c031846ae5c1f0a19426
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.
sys/fs/nfs/nfs_commonkrpc.c
sys/fs/nfsclient/nfsmount.h