WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] blkfront: fix data size for xenbus_gather in, bl

To: Marek Marczykowski <marmarek@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] blkfront: fix data size for xenbus_gather in, blkfront_connect
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Tue, 3 May 2011 13:58:25 +0100
Cc: Fitzhardinge <jeremy@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Jeremy, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Delivery-date: Tue, 03 May 2011 06:00:55 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4DBE902B.7050200@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: Citrix Systems, Inc.
References: <4DBE902B.7050200@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Mon, 2011-05-02 at 12:06 +0100, Marek Marczykowski wrote:
> 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@xxxxxxxxxxxx>

Good catch.

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

> ---
>  drivers/block/xen-blkfront.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index 70f3b1b..6147a4e 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -1151,7 +1151,7 @@ static void blkfront_connect(struct blkfront_info
> *info)
>       }
> 
>       err = xenbus_gather(XBT_NIL, info->xbdev->otherend,
> -                         "feature-barrier", "%lu", &barrier,
> +                         "feature-barrier", "%d", &barrier,
>                           NULL);
> 
>       /*
> 



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel