All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>,
	"Alberto Garcia" <berto@igalia.com>
Cc: qemu-devel@nongnu.org, "Marc-André Lureau" <marcandre.lureau@redhat.com>
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	[thread overview]
Message-ID: <a7e15d04-c8d5-4415-fdea-c71015607965@redhat.com> (raw)
In-Reply-To: <20190206124902.GI12331@redhat.com>

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

  reply	other threads:[~2019-02-06 12:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-06 12:43 [Qemu-devel] [RFC PATCH] char-socket: hold chr_write_lock during tcp_chr_free_connection() Alberto Garcia
2019-02-06 12:49 ` Daniel P. Berrangé
2019-02-06 12:52   ` Paolo Bonzini [this message]
2019-02-06 13:14     ` Daniel P. Berrangé
2019-02-06 13:01   ` Alberto Garcia
2019-02-06 13:00 ` Paolo Bonzini
2019-02-06 13:23   ` Alberto Garcia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a7e15d04-c8d5-4415-fdea-c71015607965@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=berrange@redhat.com \
    --cc=berto@igalia.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.