diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-01-08 10:08:33 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2013-02-01 10:13:47 -0500 |
commit | ad2368d6f5ec6467b9503176e9fb878daf999629 (patch) | |
tree | 0688b822d1b969a9b0771a7b10e4a9420f9cf418 /net | |
parent | 45bc0dce9879505d6fd9ff68dcd0359fb260dfd7 (diff) |
SUNRPC: Avoid RCU dereferences in the transport bind and connect code
Avoid an RCU dereference by removing task->tk_xprt
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/clnt.c | 4 | ||||
-rw-r--r-- | net/sunrpc/xprt.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 6b3411ba23f1..a9f7906c1a6a 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -1508,7 +1508,7 @@ rpc_xdr_encode(struct rpc_task *task) | |||
1508 | static void | 1508 | static void |
1509 | call_bind(struct rpc_task *task) | 1509 | call_bind(struct rpc_task *task) |
1510 | { | 1510 | { |
1511 | struct rpc_xprt *xprt = task->tk_xprt; | 1511 | struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; |
1512 | 1512 | ||
1513 | dprint_status(task); | 1513 | dprint_status(task); |
1514 | 1514 | ||
@@ -1602,7 +1602,7 @@ retry_timeout: | |||
1602 | static void | 1602 | static void |
1603 | call_connect(struct rpc_task *task) | 1603 | call_connect(struct rpc_task *task) |
1604 | { | 1604 | { |
1605 | struct rpc_xprt *xprt = task->tk_xprt; | 1605 | struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; |
1606 | 1606 | ||
1607 | dprintk("RPC: %5u call_connect xprt %p %s connected\n", | 1607 | dprintk("RPC: %5u call_connect xprt %p %s connected\n", |
1608 | task->tk_pid, xprt, | 1608 | task->tk_pid, xprt, |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 7f3a01a8cae7..846c34fdee9f 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -697,7 +697,7 @@ out_abort: | |||
697 | */ | 697 | */ |
698 | void xprt_connect(struct rpc_task *task) | 698 | void xprt_connect(struct rpc_task *task) |
699 | { | 699 | { |
700 | struct rpc_xprt *xprt = task->tk_xprt; | 700 | struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; |
701 | 701 | ||
702 | dprintk("RPC: %5u xprt_connect xprt %p %s connected\n", task->tk_pid, | 702 | dprintk("RPC: %5u xprt_connect xprt %p %s connected\n", task->tk_pid, |
703 | xprt, (xprt_connected(xprt) ? "is" : "is not")); | 703 | xprt, (xprt_connected(xprt) ? "is" : "is not")); |
@@ -730,7 +730,7 @@ void xprt_connect(struct rpc_task *task) | |||
730 | 730 | ||
731 | static void xprt_connect_status(struct rpc_task *task) | 731 | static void xprt_connect_status(struct rpc_task *task) |
732 | { | 732 | { |
733 | struct rpc_xprt *xprt = task->tk_xprt; | 733 | struct rpc_xprt *xprt = task->tk_rqstp->rq_xprt; |
734 | 734 | ||
735 | if (task->tk_status == 0) { | 735 | if (task->tk_status == 0) { |
736 | xprt->stat.connect_count++; | 736 | xprt->stat.connect_count++; |