Skip to content

Commit 98ca649

Browse files
Anthony IliopoulosUlrich Hecht
authored andcommitted
NFSv4.1: fix backchannel max_resp_sz verification check
[ Upstream commit 191512355e520dfc45c8bc3b56d4de59c3ade33e ] When the client max_resp_sz is larger than what the server encodes in its reply, the nfs4_verify_back_channel_attrs() check fails and this causes nfs4_proc_create_session() to fail, in cases where the client page size is larger than that of the server and the server does not want to negotiate upwards. While this is not a problem with the linux nfs server that will reflect the proposed value in its reply irrespective of the local page size, other nfs server implementations may insist on their own max_resp_sz value, which could be smaller. Fix this by accepting smaller max_resp_sz values from the server, as this does not violate the protocol. The server is allowed to decrease but not increase proposed the size, and as such values smaller than the client-proposed ones are valid. Fixes: 43c2e88 ("nfs4: fix channel attribute sanity-checks") Signed-off-by: Anthony Iliopoulos <ailiop@suse.com> Reviewed-by: Benjamin Coddington <bcodding@redhat.com> Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Ulrich Hecht <uli@kernel.org>
1 parent 7eab5c4 commit 98ca649

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/nfs/nfs4proc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8395,7 +8395,7 @@ static int nfs4_verify_back_channel_attrs(struct nfs41_create_session_args *args
83958395
goto out;
83968396
if (rcvd->max_rqst_sz > sent->max_rqst_sz)
83978397
return -EINVAL;
8398-
if (rcvd->max_resp_sz < sent->max_resp_sz)
8398+
if (rcvd->max_resp_sz > sent->max_resp_sz)
83998399
return -EINVAL;
84008400
if (rcvd->max_resp_sz_cached > sent->max_resp_sz_cached)
84018401
return -EINVAL;

0 commit comments

Comments
 (0)