xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: jbeulich@suse.com, linux-kernel@vger.kernel.org,
	xen-devel@lists.xensource.com, axboe@kernel.dk
Subject: [PATCH] fixes to xen-blk[back|front] to deal with 32/64 host/guest combination with BLKIF_DISCARD (v1).
Date: Fri, 25 May 2012 17:50:01 -0400	[thread overview]
Message-ID: <1337982603-15692-1-git-send-email-konrad.wilk@oracle.com> (raw)

These two patches came out of hitting https://bugzilla.redhat.com/show_bug.cgi?id=824641
where a 32-bit guest would send a BLKIF_DISCARD request to a 64-bit
host. The xen-blkback did not copy the 'id' field into the response (it ended
up with a random value), which the frontend uses to lookup in its array to
find the 'struct request' that corresponded to this BLKIF_DISCARD.

The result was the __blk_end_request_all ended being called with a NULL
pointer and crashed the guest.

The fix is easy enough - make xen-blkback copy the 'id' field when
dealing with 32/64 or 64/32 host/guest combinations. The problem
does not exist if we are using a 64/64 combination.

I also added two BUG_ON to xen-blkfront to detect this misuse of 'id'
field in case there are other backends that do this.

If there are no problems with these patches I was thinking to put them
in my stable/for-jens-3.5 tree and ask Jens to pull them.

 drivers/block/xen-blkback/common.h |    2 ++
 drivers/block/xen-blkfront.c       |    7 +++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

             reply	other threads:[~2012-05-25 21:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-25 21:50 Konrad Rzeszutek Wilk [this message]
2012-05-25 21:50 ` [PATCH 1/2] xen/blkback: Copy id field when doing BLKIF_DISCARD Konrad Rzeszutek Wilk
2012-05-28 10:19   ` [Xen-devel] " Stefano Stabellini
2012-05-30 20:39     ` William Dauchy
2012-05-30 21:16       ` Konrad Rzeszutek Wilk
2012-05-25 21:50 ` [PATCH 2/2] xen/blkfront: Add BUG_ON to deal with misbehaving backends Konrad Rzeszutek Wilk
2012-05-28 10:18   ` [Xen-devel] " Stefano Stabellini
2012-05-29  8:12     ` Jan Beulich
2012-05-31 18:17       ` Konrad Rzeszutek Wilk
2012-06-01  7:44         ` Jan Beulich
2012-06-01 10:16         ` Stefano Stabellini
2012-06-07 21:59           ` Konrad Rzeszutek Wilk
2012-06-08  7:12             ` Jan Beulich
2012-06-11 18:22               ` Konrad Rzeszutek Wilk
2012-06-11 18:52                 ` Konrad Rzeszutek Wilk
2012-06-12  8:45                   ` Jan Beulich
2012-06-08 10:06             ` Stefano Stabellini

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=1337982603-15692-1-git-send-email-konrad.wilk@oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=axboe@kernel.dk \
    --cc=jbeulich@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xen-devel@lists.xensource.com \
    /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;
as well as URLs for NNTP newsgroup(s).