HomeFreeBSD

Add a couple of safety belt checks to the NFSv4.1 client related to sessions.

Description

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.

MFC after: 2 weeks

Details

Provenance
rmacklemAuthored on
Parents
rS334965: makesyscalls: simplify capenabled pipeline
Branches
Unknown
Tags
Unknown