All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fixes to xen-blk[back|front] to deal with 32/64 host/guest combination with BLKIF_DISCARD (v1).
@ 2012-05-25 21:50 Konrad Rzeszutek Wilk
  2012-05-25 21:50 ` [PATCH 1/2] xen/blkback: Copy id field when doing BLKIF_DISCARD Konrad Rzeszutek Wilk
  2012-05-25 21:50 ` [PATCH 2/2] xen/blkfront: Add BUG_ON to deal with misbehaving backends Konrad Rzeszutek Wilk
  0 siblings, 2 replies; 17+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-05-25 21:50 UTC (permalink / raw)
  To: jbeulich, linux-kernel, xen-devel, axboe

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(-)


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2012-06-12  8:44 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-25 21:50 [PATCH] fixes to xen-blk[back|front] to deal with 32/64 host/guest combination with BLKIF_DISCARD (v1) Konrad Rzeszutek Wilk
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

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.