]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
xen-blkfront: fix data size for xenbus_gather in blkfront_connect
authorMarek Marczykowski <marmarek@mimuw.edu.pl>
Tue, 3 May 2011 16:04:52 +0000 (12:04 -0400)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Fri, 17 Aug 2012 19:35:10 +0000 (15:35 -0400)
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 <marmarek@mimuw.edu.pl>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
[v1: Changed title]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
drivers/block/xen-blkfront.c

index 82ed403147c06c66143b0d5fdbcf5ddfccdc8232..5d5e1eac6a5c88cb6e00a7064ac93c5abaf35bd0 100644 (file)
@@ -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;