From: Chuck Lever <chuck.lever@oracle.com>
To: bfields@fieldses.org
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH RFC 2/2] SUNRPC: Fix buf->len calculation in unwrap_priv_data()
Date: Thu, 23 Jul 2020 19:14:50 -0400 [thread overview]
Message-ID: <159554609056.6546.5370422049655090479.stgit@klimt.1015granger.net> (raw)
In-Reply-To: <159554528704.6546.6823326959131917327.stgit@klimt.1015granger.net>
The pad adjustment logic in unwrap_priv_data() is unnecessary.
gss_unwrap() should already updates buf->len correctly; the
additional adjustment can drive buf->len negative. This causes the
nfsd_request_too_large check to fail during some NFSv3 operations.
Fixes: 31c9590ae468 ("SUNRPC: Add "@len" parameter to gss_unwrap()")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
net/sunrpc/auth_gss/svcauth_gss.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/net/sunrpc/auth_gss/svcauth_gss.c b/net/sunrpc/auth_gss/svcauth_gss.c
index 7d83f54aaaa6..9ac23d83f9a2 100644
--- a/net/sunrpc/auth_gss/svcauth_gss.c
+++ b/net/sunrpc/auth_gss/svcauth_gss.c
@@ -989,8 +989,6 @@ unwrap_priv_data(struct svc_rqst *rqstp, struct xdr_buf *buf, u32 seq, struct gs
fix_priv_head(buf, pad);
maj_stat = gss_unwrap(ctx, 0, priv_len, buf);
- pad = priv_len - buf->len;
- buf->len -= pad;
/* The upper layers assume the buffer is aligned on 4-byte boundaries.
* In the krb5p case, at least, the data ends up offset, so we need to
* move it around. */
prev parent reply other threads:[~2020-07-23 23:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-23 23:14 [PATCH RFC 0/2] Fix problems with NFSv4 on krb5p Chuck Lever
2020-07-23 23:14 ` [PATCH RFC 1/2] SUNRPC: Set rcv_buf->len correctly in gss_unwrap_kerberos_v2() Chuck Lever
2020-07-23 23:14 ` Chuck Lever [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=159554609056.6546.5370422049655090479.stgit@klimt.1015granger.net \
--to=chuck.lever@oracle.com \
--cc=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).