]> git.karo-electronics.de Git - karo-tx-linux.git/commit
xen/blkback: correctly respond to unknown, non-native requests
authorDavid Vrabel <david.vrabel@citrix.com>
Thu, 7 Mar 2013 17:32:01 +0000 (17:32 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Apr 2013 16:25:49 +0000 (09:25 -0700)
commitccaa606d2301cb33da35a463951e1ed117d927cc
tree1897a6b1606c30fbc5cb2728f77ad79ba807f752
parenta420a7e3a40a8396104d9a62f676205f2db1a671
xen/blkback: correctly respond to unknown, non-native requests

commit 0e367ae46503cfe7791460c8ba8434a5d60b2bd5 upstream.

If the frontend is using a non-native protocol (e.g., a 64-bit
frontend with a 32-bit backend) and it sent an unrecognized request,
the request was not translated and the response would have the
incorrect ID.  This may cause the frontend driver to behave
incorrectly or crash.

Since the ID field in the request is always in the same place,
regardless of the request type we can get the correct ID and make a
valid response (which will report BLKIF_RSP_EOPNOTSUPP).

This bug affected 64-bit SLES 11 guests when using a 32-bit backend.
This guest does a BLKIF_OP_RESERVED_1 (BLKIF_OP_PACKET in the SLES
source) and would crash in blkif_int() as the ID in the response would
be invalid.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/block/xen-blkback/blkback.c
drivers/block/xen-blkback/common.h
include/xen/interface/io/blkif.h