Files
kernel_arpi/net
Jiyong Park b7464d4ae5 BACKPORT: vsock: each transport cycles only on its own sockets
This is an KMI-preserving implementation of commit
8e6ed963763fe21429eabfc76c69ce2b0163a3dd upstream.

When iterating over sockets using vsock_for_each_connected_socket, make
sure that a transport filters out sockets that don't belong to the
transport.

There actually was an issue caused by this; in a nested VM
configuration, destroying the nested VM (which often involves the
closing of /dev/vhost-vsock if there was h2g connections to the nested
VM) kills not only the h2g connections, but also all existing g2h
connections to the (outmost) host which are totally unrelated.

Tested: Executed the following steps on Cuttlefish (Android running on a
VM) [1]: (1) Enter into an `adb shell` session - to have a g2h
connection inside the VM, (2) open and then close /dev/vhost-vsock by
`exec 3< /dev/vhost-vsock && exec 3<&-`, (3) observe that the adb
session is not reset.

[1] https://android.googlesource.com/device/google/cuttlefish/

Fixes: c0cfa2d8a7 ("vsock: add multi-transports support")
Signed-off-by: Jiyong Park <jiyong@google.com>
(cherry picked from commit 8e6ed963763fe21429eabfc76c69ce2b0163a3dd)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I1de1462fdb2a1b3d40c151ecc50c808ced46b5c8
2022-03-24 13:17:02 +01:00
..
2022-03-11 12:22:36 +01:00
2022-03-24 13:16:37 +01:00
2022-03-19 13:47:46 +01:00
2022-03-17 14:02:09 +01:00
2022-03-19 14:36:07 +01:00