search for: sk_shutdown

Displaying 20 results from an estimated 36 matches for "sk_shutdown".

Did you mean: _shutdown
2020 May 31
0
[PATCH v3] virtio_vsock: Fix race condition in virtio_transport_recv_pkt
...===== > __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_socket->state (panic!) > > The root cause is that vsoc...
2020 May 29
0
[PATCH v2] virtio_vsock: Fix race condition in virtio_transport_recv_pkt
...===== > __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->sk_socket->state (panic) > > The root cause is that vsock_find_boun...
2020 May 29
0
[PATCH] virtio_vsock: Fix race condition in virtio_transport_recv_pkt
...cted_table(vsk)) { > + spin_unlock_bh(&vsock_table_lock); > + (void)virtio_transport_reset_no_sock(t, pkt); > + release_sock(sk); > + sock_put(sk); > + goto free_pkt; > + } > + spin_unlock_bh(&vsock_table_lock); > + As an a simpler alternative, can we check the sk_shutdown or the socket state without check again both bound and connected tables? This is a data path, so we should take it faster. I mean something like this: if (sk->sk_shutdown == SHUTDOWN_MASK) { ... } or if (sock_flag(sk, SOCK_DEAD)) { ... } I prefer the first option, but I think also...
2023 Aug 22
0
[RFC PATCH v1 1/2] vsock: send SIGPIPE on write to shutdowned socket
...how to interpret this from above (but again - SIGPIPE is related for SOCK_STREAM >only): > >**" and is no longer connected"** > >IIUC, if we follow POSIX strictly, this check must be like: > >/* socket is shut down for writing or no longer connected. */ >if (sk->sk_shutdown & SEND_SHUTDOWN || > vsk->peer_shutdown & RCV_SHUTDOWN || > sock_flag(SOCK_DONE)) { > err = -EPIPE; > goto out; >} > >... > >out: > /* Handle -EPIPE for stream socket which is no longer connected. */ > if (sk->sk_type == SOCK_STREAM && &g...
2016 Jun 30
0
[PATCH net-next V3 6/6] tun: switch to use skb array for tx
...un, struct file *file, bool skip_filte if (!err) goto out; } + + if (!tfile->detached && + skb_array_init(&tfile->tx_array, dev->tx_queue_len, GFP_KERNEL)) { + err = -ENOMEM; + goto out; + } + tfile->queue_index = tun->numqueues; tfile->socket.sk->sk_shutdown &= ~RCV_SHUTDOWN; rcu_assign_pointer(tfile->tun, tun); @@ -891,8 +907,8 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev) nf_reset(skb); - /* Enqueue packet */ - skb_queue_tail(&tfile->socket.sk->sk_receive_queue, skb); + if (skb_array_produce(...
2008 Dec 14
5
[PATCH] AF_VMCHANNEL address family for guest<->host communication.
...et *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(sk); + return 0; +} + +/* Bind an unbound socket */ +static int vmchannel_sock_bind(struct socket *sock, struct sockaddr...
2008 Dec 14
5
[PATCH] AF_VMCHANNEL address family for guest<->host communication.
...et *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(sk); + return 0; +} + +/* Bind an unbound socket */ +static int vmchannel_sock_bind(struct socket *sock, struct sockaddr...
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
2016 Jun 17
0
[PATCH net-next V2] tun: introduce tx skb ring
...+ if (!tfile->detached && tun->flags & IFF_TX_ARRAY && > + skb_array_init(&tfile->tx_array, TUN_RING_SIZE, GFP_KERNEL)) { > + err = -ENOMEM; > + goto out; > + } > + > tfile->queue_index = tun->numqueues; > tfile->socket.sk->sk_shutdown &= ~RCV_SHUTDOWN; > rcu_assign_pointer(tfile->tun, tun); > @@ -891,8 +910,13 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev) > > nf_reset(skb); > > - /* Enqueue packet */ > - skb_queue_tail(&tfile->socket.sk->sk_receive_q...
2016 Apr 12
2
[RFC v5 0/5] Add virtio transport for AF_VSOCK
On Mon, Apr 11, 2016 at 03:54:08PM +0300, Michael S. Tsirkin wrote: > On Mon, Apr 11, 2016 at 11:45:48AM +0100, Stefan Hajnoczi wrote: > > On Fri, Apr 08, 2016 at 04:35:05PM +0100, Ian Campbell wrote: > > > On Fri, 2016-04-01 at 15:23 +0100, Stefan Hajnoczi wrote: > > > > This series is based on Michael Tsirkin's vhost branch (v4.5-rc6). > > > > >
2016 Apr 12
2
[RFC v5 0/5] Add virtio transport for AF_VSOCK
On Mon, Apr 11, 2016 at 03:54:08PM +0300, Michael S. Tsirkin wrote: > On Mon, Apr 11, 2016 at 11:45:48AM +0100, Stefan Hajnoczi wrote: > > On Fri, Apr 08, 2016 at 04:35:05PM +0100, Ian Campbell wrote: > > > On Fri, 2016-04-01 at 15:23 +0100, Stefan Hajnoczi wrote: > > > > This series is based on Michael Tsirkin's vhost branch (v4.5-rc6). > > > > >
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
2016 Jun 15
7
[PATCH net-next V2] tun: introduce tx skb ring
...e if (!err) goto out; } + + if (!tfile->detached && tun->flags & IFF_TX_ARRAY && + skb_array_init(&tfile->tx_array, TUN_RING_SIZE, GFP_KERNEL)) { + err = -ENOMEM; + goto out; + } + tfile->queue_index = tun->numqueues; tfile->socket.sk->sk_shutdown &= ~RCV_SHUTDOWN; rcu_assign_pointer(tfile->tun, tun); @@ -891,8 +910,13 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev) nf_reset(skb); - /* Enqueue packet */ - skb_queue_tail(&tfile->socket.sk->sk_receive_queue, skb); + if (tun->flags &am...
2016 Jun 15
7
[PATCH net-next V2] tun: introduce tx skb ring
...e if (!err) goto out; } + + if (!tfile->detached && tun->flags & IFF_TX_ARRAY && + skb_array_init(&tfile->tx_array, TUN_RING_SIZE, GFP_KERNEL)) { + err = -ENOMEM; + goto out; + } + tfile->queue_index = tun->numqueues; tfile->socket.sk->sk_shutdown &= ~RCV_SHUTDOWN; rcu_assign_pointer(tfile->tun, tun); @@ -891,8 +910,13 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev) nf_reset(skb); - /* Enqueue packet */ - skb_queue_tail(&tfile->socket.sk->sk_receive_queue, skb); + if (tun->flags &am...
2019 Sep 27
0
[PATCH net v2] vsock: Fix a lockdep warning in __vsock_release()
...{ 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_release(pending); + _...
2019 Oct 01
0
[PATCH net v3] vsock: Fix a lockdep warning in __vsock_release()
...e 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); > + __vsock_release(pending, SINGL...
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. * *