mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: Jan Beulich <JBeulich@suse.com>
Cc: konrad.wilk@oracle.com, xen-devel@lists.xen.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] xen/blkback: do not leak mode property
Date: Tue, 4 Dec 2012 19:21:51 +0100	[thread overview]
Message-ID: <20121204182151.GA25878@aepfle.de> (raw)
In-Reply-To: <50BDDEBF02000078000ADAAC@nat28.tlf.novell.com>

On Tue, Dec 04, Jan Beulich wrote:

> This looks necessary but insufficient - there's nothing really
> preventing backend_changed() from being called more than once
> for a given device (is simply the handler of xenbus watch). Hence
> I think either that function needs to be guarded against multiple
> execution (e.g. by removing the watch from that function itself,
> if that's permitted by xenbus), or to properly deal with the
> effects this has (including but probably not limited to the leaking
> of be->mode).

If another watch does really trigger after the kfree(be) in
xen_blkbk_remove(), wouldnt backend_changed access stale memory?
So if that can really happen in practice, shouldnt the backend_watch be
a separate allocation instead being contained within backend_info?

Looking at unregister_xenbus_watch, it clears removes the watch from the
list, so that process_msg will not see it anymore.

Olaf

  reply	other threads:[~2012-12-04 18:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-03 19:32 Olaf Hering
2012-12-04 10:30 ` Jan Beulich
2012-12-04 18:21   ` Olaf Hering [this message]
2012-12-05  8:00     ` Jan Beulich

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=20121204182151.GA25878@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=JBeulich@suse.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®