Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 154916 Details for
Bug 240419
nfsv3 on krb5i printk's many RPC request reserved XXX but used YYY
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
patch -- add svc_reserve_auth to account for checksum
0014-BZ-227726-When-downsizing-RPC-response-buffer-acco.patch (text/plain), 3.78 KB, created by
Jeff Layton
on 2007-05-17 13:17:10 UTC
(
hide
)
Description:
patch -- add svc_reserve_auth to account for checksum
Filename:
MIME Type:
Creator:
Jeff Layton
Created:
2007-05-17 13:17:10 UTC
Size:
3.78 KB
patch
obsolete
>From 7b8849898485ca53803c202e9c3efe5321d6c0a4 Mon Sep 17 00:00:00 2001 >From: Jeffrey Layton <jlayton@dantu.rdu.redhat.com> >Date: Wed, 2 May 2007 11:09:45 -0400 >Subject: [PATCH] BZ#227726: When downsizing RPC response buffer, account for checksum length > >--- > fs/nfsd/nfs3proc.c | 2 +- > fs/nfsd/nfsproc.c | 2 +- > include/linux/sunrpc/auth.h | 3 --- > include/linux/sunrpc/msg_prot.h | 3 +++ > include/linux/sunrpc/svc.h | 19 +++++++++++++++++++ > net/sunrpc/svc.c | 2 +- > 6 files changed, 25 insertions(+), 6 deletions(-) > >diff --git a/fs/nfsd/nfs3proc.c b/fs/nfsd/nfs3proc.c >index effcd19..105364c 100644 >--- a/fs/nfsd/nfs3proc.c >+++ b/fs/nfsd/nfs3proc.c >@@ -168,7 +168,7 @@ nfsd3_proc_read(struct svc_rqst *rqstp, struct nfsd3_readargs *argp, > if (NFSSVC_MAXBLKSIZE < resp->count) > resp->count = NFSSVC_MAXBLKSIZE; > >- svc_reserve(rqstp, ((1 + NFS3_POST_OP_ATTR_WORDS + 3)<<2) + resp->count +4); >+ svc_reserve_auth(rqstp, ((1 + NFS3_POST_OP_ATTR_WORDS + 3)<<2) + resp->count +4); > > fh_copy(&resp->fh, &argp->fh); > nfserr = nfsd_read(rqstp, &resp->fh, >diff --git a/fs/nfsd/nfsproc.c b/fs/nfsd/nfsproc.c >index 231e148..515a114 100644 >--- a/fs/nfsd/nfsproc.c >+++ b/fs/nfsd/nfsproc.c >@@ -134,7 +134,7 @@ nfsd_proc_read(struct svc_rqst *rqstp, struct nfsd_readargs *argp, > argp->count); > argp->count = NFSSVC_MAXBLKSIZE; > } >- svc_reserve(rqstp, (19<<2) + argp->count + 4); >+ svc_reserve_auth(rqstp, (19<<2) + argp->count + 4); > > resp->count = argp->count; > nfserr = nfsd_read(rqstp, fh_copy(&resp->fh, &argp->fh), >diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h >index a196e9b..81f9cf8 100644 >--- a/include/linux/sunrpc/auth.h >+++ b/include/linux/sunrpc/auth.h >@@ -21,9 +21,6 @@ > /* size of the nodename buffer */ > #define UNX_MAXNODENAME 32 > >-/* Maximum size (in bytes) of an rpc credential or verifier */ >-#define RPC_MAX_AUTH_SIZE (400) >- > /* Work around the lack of a VFS credential */ > struct auth_cred { > uid_t uid; >diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h >index 15f1153..2a4fbd5 100644 >--- a/include/linux/sunrpc/msg_prot.h >+++ b/include/linux/sunrpc/msg_prot.h >@@ -34,6 +34,9 @@ enum rpc_auth_flavors { > RPC_AUTH_GSS_SPKMP = 390011, > }; > >+/* Maximum size (in bytes) of an rpc credential or verifier */ >+#define RPC_MAX_AUTH_SIZE (400) >+ > enum rpc_msg_type { > RPC_CALL = 0, > RPC_REPLY = 1 >diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h >index 564bb97..6266324 100644 >--- a/include/linux/sunrpc/svc.h >+++ b/include/linux/sunrpc/svc.h >@@ -318,4 +318,23 @@ int svc_register(struct svc_serv *, int, unsigned short); > void svc_wake_up(struct svc_serv *); > void svc_reserve(struct svc_rqst *rqstp, int space); > >+/* >+ * When we want to reduce the size of the reserved space in the response >+ * buffer, we need to take into account the size of any checksum data that >+ * may be at the end of the packet. This is difficult to determine exactly >+ * for all cases without actually generating the checksum, so we just use a >+ * static value. >+ */ >+static inline void >+svc_reserve_auth(struct svc_rqst *rqstp, int space) >+{ >+ int added_space = 0; >+ >+ switch(rqstp->rq_authop->flavour) { >+ case RPC_AUTH_GSS: >+ added_space = RPC_MAX_AUTH_SIZE; >+ } >+ return svc_reserve(rqstp, space + added_space); >+} >+ > #endif /* SUNRPC_SVC_H */ >diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c >index 570c4a9..5ad2d03 100644 >--- a/net/sunrpc/svc.c >+++ b/net/sunrpc/svc.c >@@ -377,7 +377,7 @@ svc_process(struct svc_serv *serv, struct svc_rqst *rqstp) > * better idea of reply size > */ > if (procp->pc_xdrressize) >- svc_reserve(rqstp, procp->pc_xdrressize<<2); >+ svc_reserve_auth(rqstp, procp->pc_xdrressize<<2); > > /* Call the function that processes the request. */ > if (!versp->vs_dispatch) { >-- >1.5.0.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 240419
: 154916