[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC PATCH] char-socket: hold chr_write_lock during tcp
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [RFC PATCH] char-socket: hold chr_write_lock during tcp_chr_free_connection() |
Date: |
Wed, 6 Feb 2019 13:52:59 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 |
On 06/02/19 13:49, Daniel P. Berrangé wrote:
> On Wed, Feb 06, 2019 at 02:43:45PM +0200, Alberto Garcia wrote:
>> There's a race condition in which the tcp_chr_read() ioc handler can
>> close a connection that is being written to from another thread.
> Isn't the chardev only ever supposed to be read/written from a
> single thread.
>
No, writes from multiple threads are allowed; of course they have to
have proper locking to avoid mixing messages.
Reads have to happen from a single thread because they are tied to the
chr_read handlers.
Paolo