From: J. Bruce Fields Date: Tue, 21 Jan 2014 16:06:52 +0000 (-0500) Subject: nfsd4: reserve head space for krb5 integ/priv info X-Git-Tag: v3.16-rc1~58^2~70 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=1802a67894fab3ff90a3ef4f484e97a5b4515426;p=~emulex%2Finfiniband.git nfsd4: reserve head space for krb5 integ/priv info Currently if the nfs-level part of a reply would be too large, we'll return an error to the client. But if the nfs-level part fits and leaves no room for krb5p or krb5i stuff, then we just drop the request entirely. That's no good. Instead, reserve some slack space at the end of the buffer and make sure we fail outright if we'd come close. The slack space here is a massive overstimate of what's required, we should probably try for a tighter limit at some point. Signed-off-by: J. Bruce Fields --- diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index f809aa8d921..747d6a87a47 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1262,7 +1262,7 @@ static void svcxdr_init_encode(struct svc_rqst *rqstp, xdr->buf = buf; xdr->p = head->iov_base + head->iov_len; - xdr->end = head->iov_base + PAGE_SIZE; + xdr->end = head->iov_base + PAGE_SIZE - 2 * RPC_MAX_AUTH_SIZE; } /*