Re: [PATCH 1/1] vhost: Fix crash during early vhost_transport_send_pkt calls

2023-06-07 Thread Stefano Garzarella
On Tue, Jun 06, 2023 at 12:19:10PM -0500, Mike Christie wrote: On 6/6/23 4:49 AM, Stefano Garzarella wrote: On Mon, Jun 05, 2023 at 01:57:30PM -0500, Mike Christie wrote: If userspace does VHOST_VSOCK_SET_GUEST_CID before VHOST_SET_OWNER we can race where: 1. thread0 calls

Re: [PATCH 1/1] vhost: Fix crash during early vhost_transport_send_pkt calls

2023-06-06 Thread Mike Christie
On 6/6/23 2:22 PM, Michael S. Tsirkin wrote: > On Tue, Jun 06, 2023 at 12:19:10PM -0500, Mike Christie wrote: >> On 6/6/23 4:49 AM, Stefano Garzarella wrote: >>> On Mon, Jun 05, 2023 at 01:57:30PM -0500, Mike Christie wrote: If userspace does VHOST_VSOCK_SET_GUEST_CID before VHOST_SET_OWNER

Re: [PATCH 1/1] vhost: Fix crash during early vhost_transport_send_pkt calls

2023-06-06 Thread Michael S. Tsirkin
On Tue, Jun 06, 2023 at 12:19:10PM -0500, Mike Christie wrote: > On 6/6/23 4:49 AM, Stefano Garzarella wrote: > > On Mon, Jun 05, 2023 at 01:57:30PM -0500, Mike Christie wrote: > >> If userspace does VHOST_VSOCK_SET_GUEST_CID before VHOST_SET_OWNER we > >> can race where: > >> 1. thread0 calls

Re: [PATCH 1/1] vhost: Fix crash during early vhost_transport_send_pkt calls

2023-06-06 Thread Mike Christie
On 6/6/23 4:49 AM, Stefano Garzarella wrote: > On Mon, Jun 05, 2023 at 01:57:30PM -0500, Mike Christie wrote: >> If userspace does VHOST_VSOCK_SET_GUEST_CID before VHOST_SET_OWNER we >> can race where: >> 1. thread0 calls vhost_transport_send_pkt -> vhost_work_queue >> 2. thread1 does

Re: [PATCH 1/1] vhost: Fix crash during early vhost_transport_send_pkt calls

2023-06-06 Thread Stefano Garzarella
On Mon, Jun 05, 2023 at 01:57:30PM -0500, Mike Christie wrote: If userspace does VHOST_VSOCK_SET_GUEST_CID before VHOST_SET_OWNER we can race where: 1. thread0 calls vhost_transport_send_pkt -> vhost_work_queue 2. thread1 does VHOST_SET_OWNER which calls vhost_worker_create. 3.