Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix locking when writing to connections
There are 2 race conditions when writing to connections: - Since we don't hold the semaphore during iteration, a connection can be removed by another thread while we try to use it, which will lead to use after free. - Multiple threads may try to write to the same connection socket, corrupting the packets (lima-vm#39). Both issues are fixed by holding the semaphore during iteration and writing to the socket. This is not the most efficient way but socket_vmnet crashes daily and we must stop the bleeding first. We can to add more fine grain locking later.
- Loading branch information