rxrpc: Fix user call ID check in rxrpc_service_prealloc_one
authorYueHaibing <yuehaibing@huawei.com>
Wed, 1 Aug 2018 12:27:23 +0000 (13:27 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 1 Aug 2018 18:49:49 +0000 (11:49 -0700)
There just check the user call ID isn't already in use, hence should
compare user_call_ID with xcall->user_call_ID, which is current
node's user_call_ID.

Fixes: 540b1c48c37a ("rxrpc: Fix deadlock between call creation and sendmsg/recvmsg")
Suggested-by: David Howells <dhowells@redhat.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rxrpc/call_accept.c

index a9a9be5..9d1e298 100644 (file)
@@ -116,9 +116,9 @@ static int rxrpc_service_prealloc_one(struct rxrpc_sock *rx,
                while (*pp) {
                        parent = *pp;
                        xcall = rb_entry(parent, struct rxrpc_call, sock_node);
-                       if (user_call_ID < call->user_call_ID)
+                       if (user_call_ID < xcall->user_call_ID)
                                pp = &(*pp)->rb_left;
-                       else if (user_call_ID > call->user_call_ID)
+                       else if (user_call_ID > xcall->user_call_ID)
                                pp = &(*pp)->rb_right;
                        else
                                goto id_in_use;