Skip to contentSkip to conversation

linux-2.6.18/blkfront: fix data size for xenbus_gather in connect()

PATCH New Jan Beulich 1 participant 1 message May 6, 2011 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-2.6.18/blkfront: fix data size for xenbus_gather in connect()

From: Marek Marczykowski <[email protected]>

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

drivers/xen/blkfront/blkfront.c +1 -1
@@ -364,7 +364,7 @@ static void connect(struct blkfront_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;

From: Marek Marczykowski <[email protected]>
Subject: blkfront: fix data size for xenbus_gather in connect()

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

drivers/xen/blkfront/blkfront.c +1 -1
@@ -364,7 +364,7 @@ static void connect(struct blkfront_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;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel