Skip to content

Commit 0c217d5

Browse files
neilbrownchucklever
authored andcommitted
SUNRPC: improve error response to over-size gss credential
When the NFS server receives a large gss (kerberos) credential and tries to pass it up to rpc.svcgssd (which is deprecated), it triggers an infinite loop in cache_read(). cache_request() always returns -EAGAIN, and this causes a "goto again". This patch: - changes the error to -E2BIG to avoid the infinite loop, and - generates a WARN_ONCE when rsi_request first sees an over-sized credential. The warning suggests switching to gssproxy. Link: https://bugzilla.kernel.org/show_bug.cgi?id=196583 Signed-off-by: NeilBrown <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent e38b3f2 commit 0c217d5

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

net/sunrpc/auth_gss/svcauth_gss.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ static void rsi_request(struct cache_detail *cd,
194194
qword_addhex(bpp, blen, rsii->in_handle.data, rsii->in_handle.len);
195195
qword_addhex(bpp, blen, rsii->in_token.data, rsii->in_token.len);
196196
(*bpp)[-1] = '\n';
197+
WARN_ONCE(*blen < 0,
198+
"RPCSEC/GSS credential too large - please use gssproxy\n");
197199
}
198200

199201
static int rsi_parse(struct cache_detail *cd,

net/sunrpc/cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,7 @@ static int cache_request(struct cache_detail *detail,
803803

804804
detail->cache_request(detail, crq->item, &bp, &len);
805805
if (len < 0)
806-
return -EAGAIN;
806+
return -E2BIG;
807807
return PAGE_SIZE - len;
808808
}
809809

0 commit comments

Comments
 (0)