From: Marek Marczykowski Date: Tue, 3 May 2011 16:04:52 +0000 (-0400) Subject: xen-blkfront: fix data size for xenbus_gather in blkfront_connect X-Git-Tag: v2.6.33.20~92 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97bbf2cf5e03109f446b0596197b444be75a9d18;p=thirdparty%2Fkernel%2Fstable.git xen-blkfront: fix data size for xenbus_gather in blkfront_connect commit 4352b47ab7918108b389a48d2163c9a4c2aaf139 upstream. barrier variable is int, not long. This overflow caused another variable override: "err" (in PV code) and "binfo" (in xenlinux code - drivers/xen/blkfront/blkfront.c). The later caused incorrect device flags (RO/removable etc). Signed-off-by: Marek Marczykowski Acked-by: Ian Campbell [v1: Changed title] Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 05a31e55d2781..ed39cb1596f2a 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c @@ -890,7 +890,7 @@ static void blkfront_connect(struct blkfront_info *info) } err = xenbus_gather(XBT_NIL, info->xbdev->otherend, - "feature-barrier", "%lu", &info->feature_barrier, + "feature-barrier", "%d", &info->feature_barrier, NULL); if (err) info->feature_barrier = 0;