]> git.hungrycats.org Git - linux/commitdiff
[PATCH] kNFSd: pre-zero response for lockd _msg requests.
authorNeil Brown <neilb@cse.unsw.edu.au>
Fri, 11 Oct 2002 12:30:54 +0000 (05:30 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Fri, 11 Oct 2002 12:30:54 +0000 (05:30 -0700)
All the lockd *_msg requests are implemented by
calling the equivalent non- *_msg request and sending off
the response as a new message (*_res).

For the non- *_msg requests, the response buffer is
pre-zeroed by the RPC layer, but the *_msg handlers weren't
pre-zeroing the buffer, would could in some circumstances lead to
an Oops.

Now we pre-zero them all.

fs/lockd/svc4proc.c
fs/lockd/svcproc.c

index 89df2ba47dd62fd65a5e2b0b131dc4863c1ecf6d..5a16cc3a9493d3597ab2bb0a51f92415f9ce94cf 100644 (file)
@@ -244,6 +244,7 @@ nlm4svc_proc_test_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
        u32             stat;
 
        dprintk("lockd: TEST_MSG      called\n");
+       memset(&res, 0, sizeof(res));
 
        if ((stat = nlm4svc_proc_test(rqstp, argp, &res)) == 0)
                stat = nlm4svc_callback(rqstp, NLMPROC_TEST_RES, &res);
@@ -258,6 +259,7 @@ nlm4svc_proc_lock_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
        u32             stat;
 
        dprintk("lockd: LOCK_MSG      called\n");
+       memset(&res, 0, sizeof(res));
 
        if ((stat = nlm4svc_proc_lock(rqstp, argp, &res)) == 0)
                stat = nlm4svc_callback(rqstp, NLMPROC_LOCK_RES, &res);
@@ -272,6 +274,7 @@ nlm4svc_proc_cancel_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
        u32             stat;
 
        dprintk("lockd: CANCEL_MSG    called\n");
+       memset(&res, 0, sizeof(res));
 
        if ((stat = nlm4svc_proc_cancel(rqstp, argp, &res)) == 0)
                stat = nlm4svc_callback(rqstp, NLMPROC_CANCEL_RES, &res);
@@ -286,6 +289,7 @@ nlm4svc_proc_unlock_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
        u32             stat;
 
        dprintk("lockd: UNLOCK_MSG    called\n");
+       memset(&res, 0, sizeof(res));
 
        if ((stat = nlm4svc_proc_unlock(rqstp, argp, &res)) == 0)
                stat = nlm4svc_callback(rqstp, NLMPROC_UNLOCK_RES, &res);
@@ -300,6 +304,7 @@ nlm4svc_proc_granted_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
        u32             stat;
 
        dprintk("lockd: GRANTED_MSG   called\n");
+       memset(&res, 0, sizeof(res));
 
        if ((stat = nlm4svc_proc_granted(rqstp, argp, &res)) == 0)
                stat = nlm4svc_callback(rqstp, NLMPROC_GRANTED_RES, &res);
index 3d8a9a416ce03f1fe237d99b78cb7c0ee7d47525..40b6d91ba06dd75e91329f046de9612b59ab0a7a 100644 (file)
@@ -272,6 +272,7 @@ nlmsvc_proc_test_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
        u32             stat;
 
        dprintk("lockd: TEST_MSG      called\n");
+       memset(&res, 0, sizeof(res));
 
        if ((stat = nlmsvc_proc_test(rqstp, argp, &res)) == 0)
                stat = nlmsvc_callback(rqstp, NLMPROC_TEST_RES, &res);
@@ -286,6 +287,7 @@ nlmsvc_proc_lock_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
        u32             stat;
 
        dprintk("lockd: LOCK_MSG      called\n");
+       memset(&res, 0, sizeof(res));
 
        if ((stat = nlmsvc_proc_lock(rqstp, argp, &res)) == 0)
                stat = nlmsvc_callback(rqstp, NLMPROC_LOCK_RES, &res);
@@ -300,6 +302,7 @@ nlmsvc_proc_cancel_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
        u32             stat;
 
        dprintk("lockd: CANCEL_MSG    called\n");
+       memset(&res, 0, sizeof(res));
 
        if ((stat = nlmsvc_proc_cancel(rqstp, argp, &res)) == 0)
                stat = nlmsvc_callback(rqstp, NLMPROC_CANCEL_RES, &res);
@@ -314,6 +317,7 @@ nlmsvc_proc_unlock_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
        u32             stat;
 
        dprintk("lockd: UNLOCK_MSG    called\n");
+       memset(&res, 0, sizeof(res));
 
        if ((stat = nlmsvc_proc_unlock(rqstp, argp, &res)) == 0)
                stat = nlmsvc_callback(rqstp, NLMPROC_UNLOCK_RES, &res);
@@ -328,6 +332,7 @@ nlmsvc_proc_granted_msg(struct svc_rqst *rqstp, struct nlm_args *argp,
        u32             stat;
 
        dprintk("lockd: GRANTED_MSG   called\n");
+       memset(&res, 0, sizeof(res));
 
        if ((stat = nlmsvc_proc_granted(rqstp, argp, &res)) == 0)
                stat = nlmsvc_callback(rqstp, NLMPROC_GRANTED_RES, &res);