Skip to content

Commit

Permalink
vhost-vsock: fix orphan connection reset
Browse files Browse the repository at this point in the history
local_addr.svm_cid is host cid. We should check guest cid instead,
which is remote_addr.svm_cid. Otherwise we end up resetting all
connections to all guests.

Cc: stable@vger.kernel.org [4.8+]
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Peng Tao authored and David S. Miller committed Dec 9, 2016
1 parent 1e97426 commit c458763
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/vhost/vsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ static void vhost_vsock_reset_orphans(struct sock *sk)
* executing.
*/

if (!vhost_vsock_get(vsk->local_addr.svm_cid)) {
if (!vhost_vsock_get(vsk->remote_addr.svm_cid)) {
sock_set_flag(sk, SOCK_DONE);
vsk->peer_shutdown = SHUTDOWN_MASK;
sk->sk_state = SS_UNCONNECTED;
Expand Down

0 comments on commit c458763

Please sign in to comment.