Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rxrpc: Fix user call ID check in rxrpc_service_prealloc_one

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>

authored by

YueHaibing and committed by
David S. Miller
c01f6c9b a94c689e

+2 -2
+2 -2
net/rxrpc/call_accept.c
··· 116 116 while (*pp) { 117 117 parent = *pp; 118 118 xcall = rb_entry(parent, struct rxrpc_call, sock_node); 119 - if (user_call_ID < call->user_call_ID) 119 + if (user_call_ID < xcall->user_call_ID) 120 120 pp = &(*pp)->rb_left; 121 - else if (user_call_ID > call->user_call_ID) 121 + else if (user_call_ID > xcall->user_call_ID) 122 122 pp = &(*pp)->rb_right; 123 123 else 124 124 goto id_in_use;