search for: sock_orphan

Displaying 20 results from an estimated 20 matches for "sock_orphan".

2020 May 31
0
[PATCH v3] virtio_vsock: Fix race condition in virtio_transport_recv_pkt
...Task1 Task2 > ===== ===== > __sock_release virtio_transport_recv_pkt > __vsock_release vsock_find_bound_socket (found sk) > lock_sock_nested > vsock_remove_sock > sock_orphan > sk_set_socket(sk, NULL) > sk->sk_shutdown = SHUTDOWN_MASK > ... > release_sock > lock_sock > virtio_transport_recv_connecting > sk->sk_s...
2020 May 29
0
[PATCH] virtio_vsock: Fix race condition in virtio_transport_recv_pkt
...n as follows: > Task1 Task2 > ===== ===== > __sock_release virtio_transport_recv_pkt > __vsock_release vsock_find_bound_socket (found) > lock_sock_nested > vsock_remove_sock > sock_orphan > sk_set_socket(sk, NULL) > ... > release_sock > lock_sock > virtio_transport_recv_connecting > sk->sk_socket->state (panic) > > This fixes it by chec...
2020 May 29
0
[PATCH v2] virtio_vsock: Fix race condition in virtio_transport_recv_pkt
...n as follows: > Task1 Task2 > ===== ===== > __sock_release virtio_transport_recv_pkt > __vsock_release vsock_find_bound_socket (found) > lock_sock_nested > vsock_remove_sock > sock_orphan > sk_set_socket(sk, NULL) Here we can add: sk->sk_shutdown = SHUTDOWN_MASK; > ... > release_sock > lock_sock > virtio_transport_recv_connecting > sk-&gt...
2019 Sep 27
0
[PATCH net v2] vsock: Fix a lockdep warning in __vsock_release()
...ck_release(struct sock *sk, int level) { if (sk) { struct sk_buff *skb; @@ -650,7 +650,7 @@ static void __vsock_release(struct sock *sk) transport->release(vsk); - lock_sock(sk); + lock_sock_nested(sk, level); sock_orphan(sk); sk->sk_shutdown = SHUTDOWN_MASK; @@ -659,7 +659,7 @@ static void __vsock_release(struct sock *sk) /* Clean up any sockets that never were accepted. */ while ((pending = vsock_dequeue_accept(sk)) != NULL) { - __vsock_rel...
2019 Oct 01
0
[PATCH net v3] vsock: Fix a lockdep warning in __vsock_release()
...uot; is SINGLE_DEPTH_NESTING, use the nested > + * version to avoid the warning "possible recursive locking > + * detected". When "level" is 0, lock_sock_nested(sk, level) > + * is the same as lock_sock(sk). > + */ > + lock_sock_nested(sk, level); > sock_orphan(sk); > sk->sk_shutdown = SHUTDOWN_MASK; > > @@ -659,7 +667,7 @@ static void __vsock_release(struct sock *sk) > > /* Clean up any sockets that never were accepted. */ > while ((pending = vsock_dequeue_accept(sk)) != NULL) { > - __vsock_release(pending); > +...
2019 Sep 26
0
[PATCH net v2] vsock: Fix a lockdep warning in __vsock_release()
...vel == 1) > + lock_sock(sk); Since lock_sock() calls lock_sock_nested(sk, 0), could we use directly lock_sock_nested(sk, level) with level = 0 in vsock_release() and level = SINGLE_DEPTH_NESTING here in the while loop? > + else > + lock_sock_nested(sk, SINGLE_DEPTH_NESTING); > sock_orphan(sk); > sk->sk_shutdown = SHUTDOWN_MASK; > > @@ -659,7 +670,7 @@ static void __vsock_release(struct sock *sk) > > /* Clean up any sockets that never were accepted. */ > while ((pending = vsock_dequeue_accept(sk)) != NULL) { > - __vsock_release(pending); > +...
2019 Sep 27
0
[RFC PATCH 04/13] vsock: add 'transport' member in the struct vsock_sock
...ransport->init(vsk, psk) < 0) { sk_free(sk); return NULL; } @@ -638,7 +641,7 @@ static void __vsock_release(struct sock *sk) vsk = vsock_sk(sk); pending = NULL; /* Compiler warning. */ - transport->release(vsk); + vsk->transport->release(vsk); lock_sock(sk); sock_orphan(sk); @@ -662,7 +665,7 @@ static void vsock_sk_destruct(struct sock *sk) { struct vsock_sock *vsk = vsock_sk(sk); - transport->destruct(vsk); + vsk->transport->destruct(vsk); /* When clearing these addresses, there's no need to set the family and * possibly register the addr...
2019 Sep 27
0
[RFC PATCH 10/13] vsock: add multi-transports support
...__vsock_release(struct sock *sk) vsk = vsock_sk(sk); pending = NULL; /* Compiler warning. */ - vsk->transport->release(vsk); + if (vsk->transport) + vsk->transport->release(vsk); + else if (sk->sk_type == SOCK_STREAM) + vsock_remove_sock(vsk); lock_sock(sk); sock_orphan(sk); @@ -672,7 +723,8 @@ static void vsock_sk_destruct(struct sock *sk) { struct vsock_sock *vsk = vsock_sk(sk); - vsk->transport->destruct(vsk); + if (vsk->transport) + vsk->transport->destruct(vsk); /* When clearing these addresses, there's no need to set the family a...
2008 Dec 14
5
[PATCH] AF_VMCHANNEL address family for guest<->host communication.
...; + addr->sa_family == AF_VMCHANNEL; +} + +/* vmchannel socket OPS */ +static int vmchannel_sock_release(struct socket *sock) +{ + struct sock *sk = sock->sk; + struct vmchannel_sock *vmc = vmchannel_sk(sk); + + if (!sk) + return 0; + + vmchannel_sock_unlink(&vmchannel_sk_list, sk); + + sock_orphan(sk); + lock_sock(sk); + if (sk->sk_state == TCP_ESTABLISHED) { + sk->sk_state = TCP_CLOSE; + sk->sk_shutdown |= SEND_SHUTDOWN | RCV_SHUTDOWN; + sk->sk_err = ECONNRESET; + sk->sk_state_change(sk); + skb_queue_purge(&vmc->backlog_skb_q); + } + release_sock(sk); + sock_put(s...
2008 Dec 14
5
[PATCH] AF_VMCHANNEL address family for guest<->host communication.
...; + addr->sa_family == AF_VMCHANNEL; +} + +/* vmchannel socket OPS */ +static int vmchannel_sock_release(struct socket *sock) +{ + struct sock *sk = sock->sk; + struct vmchannel_sock *vmc = vmchannel_sk(sk); + + if (!sk) + return 0; + + vmchannel_sock_unlink(&vmchannel_sk_list, sk); + + sock_orphan(sk); + lock_sock(sk); + if (sk->sk_state == TCP_ESTABLISHED) { + sk->sk_state = TCP_CLOSE; + sk->sk_shutdown |= SEND_SHUTDOWN | RCV_SHUTDOWN; + sk->sk_err = ECONNRESET; + sk->sk_state_change(sk); + skb_queue_purge(&vmc->backlog_skb_q); + } + release_sock(sk); + sock_put(s...
2019 Sep 27
29
[RFC PATCH 00/13] vsock: add multi-transports support
Hi all, this series adds the multi-transports support to vsock, following this proposal: https://www.spinics.net/lists/netdev/msg575792.html With the multi-transports support, we can use vsock with nested VMs (using also different hypervisors) loading both guest->host and host->guest transports at the same time. Before this series, vmci-transport supported this behavior but only using
2019 Sep 27
29
[RFC PATCH 00/13] vsock: add multi-transports support
Hi all, this series adds the multi-transports support to vsock, following this proposal: https://www.spinics.net/lists/netdev/msg575792.html With the multi-transports support, we can use vsock with nested VMs (using also different hypervisors) loading both guest->host and host->guest transports at the same time. Before this series, vmci-transport supported this behavior but only using
2013 Jan 25
4
[PATCH 0/1] VM Sockets for Linux upstreaming
From: Andy King <acking at vmware.com> ** Introduce VM Sockets *** In an effort to improve the out-of-the-box experience with Linux kernels for VMware users, VMware is working on readying the VM Sockets (VSOCK, formerly VMCI Sockets) (vmw_vsock) kernel module for inclusion in the Linux kernel. The purpose of this post is to acquire feedback on the vmw_vsock kernel module. Unlike previous
2013 Jan 25
4
[PATCH 0/1] VM Sockets for Linux upstreaming
From: Andy King <acking at vmware.com> ** Introduce VM Sockets *** In an effort to improve the out-of-the-box experience with Linux kernels for VMware users, VMware is working on readying the VM Sockets (VSOCK, formerly VMCI Sockets) (vmw_vsock) kernel module for inclusion in the Linux kernel. The purpose of this post is to acquire feedback on the vmw_vsock kernel module. Unlike previous
2013 Jan 08
7
[PATCH 0/6] VSOCK for Linux upstreaming
* * * This series of VSOCK linux upstreaming patches include latest udpate from VMware to address Greg's and all other's code review comments. Summary of changes: - Rebase our linux kernel tree from v3.5 to v3.7. - Fix all checkpatch warnings and errors. Fix some checkpatch with -strict errors. This addresses Greg's comment: On 15 Nov 2012
2013 Jan 08
7
[PATCH 0/6] VSOCK for Linux upstreaming
* * * This series of VSOCK linux upstreaming patches include latest udpate from VMware to address Greg's and all other's code review comments. Summary of changes: - Rebase our linux kernel tree from v3.5 to v3.7. - Fix all checkpatch warnings and errors. Fix some checkpatch with -strict errors. This addresses Greg's comment: On 15 Nov 2012
2012 Nov 21
6
[PATCH 0/6] VSOCK for Linux upstreaming
* * * This series of VSOCK linux upstreaming patches include latest udpate from VMware. Summary of changes: - Sparse clean. - Checkpatch clean with one exception, a "complex macro" in which we can't add parentheses. - Remove all runtime assertions. - Fix device name, so that existing user clients work. - Fix VMCI handle lookup. * *
2012 Nov 21
6
[PATCH 0/6] VSOCK for Linux upstreaming
* * * This series of VSOCK linux upstreaming patches include latest udpate from VMware. Summary of changes: - Sparse clean. - Checkpatch clean with one exception, a "complex macro" in which we can't add parentheses. - Remove all runtime assertions. - Fix device name, so that existing user clients work. - Fix VMCI handle lookup. * *
2012 Oct 16
11
[PATCH 0/6] VSOCK for Linux upstreaming
* * * In an effort to improve the out-of-the-box experience with Linux kernels for VMware users, VMware is working on readying the Virtual Machine Communication Interface (vmw_vmci) and VMCI Sockets (VSOCK) (vmw_vsock) kernel modules for inclusion in the Linux kernel. The purpose of this post is to acquire feedback on the vmw_vsock kernel module. The vmw_vmci kernel module has been presented in
2012 Oct 16
11
[PATCH 0/6] VSOCK for Linux upstreaming
* * * In an effort to improve the out-of-the-box experience with Linux kernels for VMware users, VMware is working on readying the Virtual Machine Communication Interface (vmw_vmci) and VMCI Sockets (VSOCK) (vmw_vsock) kernel modules for inclusion in the Linux kernel. The purpose of this post is to acquire feedback on the vmw_vsock kernel module. The vmw_vmci kernel module has been presented in