xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] blkfront: fix data size for xenbus_gather in, blkfront_connect
@ 2011-05-02 11:06 Marek Marczykowski
  2011-05-03 12:58 ` Ian Campbell
  2011-05-03 15:40 ` Konrad Rzeszutek Wilk
  0 siblings, 2 replies; 5+ messages in thread
From: Marek Marczykowski @ 2011-05-02 11:06 UTC (permalink / raw)
  To: xen-devel


[-- Attachment #1.1: Type: text/plain, Size: 827 bytes --]

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

 	/*


[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5842 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] blkfront: fix data size for xenbus_gather in, blkfront_connect
  2011-05-02 11:06 [PATCH] blkfront: fix data size for xenbus_gather in, blkfront_connect Marek Marczykowski
@ 2011-05-03 12:58 ` Ian Campbell
  2011-05-03 15:40 ` Konrad Rzeszutek Wilk
  1 sibling, 0 replies; 5+ messages in thread
From: Ian Campbell @ 2011-05-03 12:58 UTC (permalink / raw)
  To: Marek Marczykowski
  Cc: Fitzhardinge, xen-devel@lists.xensource.com, Jeremy,
	Konrad Rzeszutek Wilk

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@mimuw.edu.pl>

Good catch.

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

> ---
>  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);
> 
>  	/*
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] blkfront: fix data size for xenbus_gather in, blkfront_connect
  2011-05-02 11:06 [PATCH] blkfront: fix data size for xenbus_gather in, blkfront_connect Marek Marczykowski
  2011-05-03 12:58 ` Ian Campbell
@ 2011-05-03 15:40 ` Konrad Rzeszutek Wilk
  2011-05-03 15:43   ` Ian Campbell
  2011-05-03 15:43   ` Marek Marczykowski
  1 sibling, 2 replies; 5+ messages in thread
From: Konrad Rzeszutek Wilk @ 2011-05-03 15:40 UTC (permalink / raw)
  To: Marek Marczykowski; +Cc: xen-devel

On Mon, May 02, 2011 at 01:06:19PM +0200, 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).

Weird, I get this:

konrad@phenom:~/work/linux$ patch -p1 < ~/for-40-blkfront 
patching file drivers/block/xen-blkfront.c
patch: **** malformed patch at line 124: *info)

Any ideas? Can you send the patch as attachment please?
> 
> Signed-off-by: Marek Marczykowski <marmarek@mimuw.edu.pl>
> ---
>  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@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] blkfront: fix data size for xenbus_gather in, blkfront_connect
  2011-05-03 15:40 ` Konrad Rzeszutek Wilk
@ 2011-05-03 15:43   ` Ian Campbell
  2011-05-03 15:43   ` Marek Marczykowski
  1 sibling, 0 replies; 5+ messages in thread
From: Ian Campbell @ 2011-05-03 15:43 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: xen-devel@lists.xensource.com, Marek Marczykowski

On Tue, 2011-05-03 at 16:40 +0100, Konrad Rzeszutek Wilk wrote:
> On Mon, May 02, 2011 at 01:06:19PM +0200, 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).
> 
> Weird, I get this:
> 
> konrad@phenom:~/work/linux$ patch -p1 < ~/for-40-blkfront 
> patching file drivers/block/xen-blkfront.c
> patch: **** malformed patch at line 124: *info)
> 
> Any ideas? Can you send the patch as attachment please?
> > 
> > Signed-off-by: Marek Marczykowski <marmarek@mimuw.edu.pl>
> > ---
> >  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)

   ^ the original path was lined wrapped in at least this spot

> >  	}
> > 
> >  	err = xenbus_gather(XBT_NIL, info->xbdev->otherend,
> > -			    "feature-barrier", "%lu", &barrier,
> > +			    "feature-barrier", "%d", &barrier,
> >  			    NULL);
> > 
> >  	/*
> > 
> 
> 
> 
> > _______________________________________________
> > Xen-devel mailing list
> > Xen-devel@lists.xensource.com
> > http://lists.xensource.com/xen-devel
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] blkfront: fix data size for xenbus_gather in, blkfront_connect
  2011-05-03 15:40 ` Konrad Rzeszutek Wilk
  2011-05-03 15:43   ` Ian Campbell
@ 2011-05-03 15:43   ` Marek Marczykowski
  1 sibling, 0 replies; 5+ messages in thread
From: Marek Marczykowski @ 2011-05-03 15:43 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: xen-devel


[-- Attachment #1.1.1: Type: text/plain, Size: 1652 bytes --]

On 03.05.2011 17:40, Konrad Rzeszutek Wilk wrote:
> On Mon, May 02, 2011 at 01:06:19PM +0200, 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).
> 
> Weird, I get this:
> 
> konrad@phenom:~/work/linux$ patch -p1 < ~/for-40-blkfront 
> patching file drivers/block/xen-blkfront.c
> patch: **** malformed patch at line 124: *info)
> 
> Any ideas? 

Ehh... my email client wrapped this line...

> Can you send the patch as attachment please?

Sure, attached.

>> Signed-off-by: Marek Marczykowski <marmarek@mimuw.edu.pl>
>> ---
>>  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@lists.xensource.com
>> http://lists.xensource.com/xen-devel
> 


-- 
Pozdrawiam / Best Regards,
Marek Marczykowski         | RLU #390519
marmarek at mimuw edu pl   | xmpp:marmarek at staszic waw pl

[-- Attachment #1.1.2: 0001-blkfront-fix-data-size-for-xenbus_gather-in-blkfront.patch --]
[-- Type: text/plain, Size: 1054 bytes --]

From e1ccf5d4a44013cd8828462d500f6d1a46358cff Mon Sep 17 00:00:00 2001
From: Marek Marczykowski <marmarek@mimuw.edu.pl>
Date: Mon, 2 May 2011 12:56:17 +0200
Subject: [PATCH] blkfront: fix data size for xenbus_gather in
 blkfront_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).

Signed-off-by: Marek Marczykowski <marmarek@mimuw.edu.pl>
---
 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);
 
 	/*
-- 
1.7.4.4


[-- Attachment #1.2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5842 bytes --]

[-- Attachment #2: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-05-03 15:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-02 11:06 [PATCH] blkfront: fix data size for xenbus_gather in, blkfront_connect Marek Marczykowski
2011-05-03 12:58 ` Ian Campbell
2011-05-03 15:40 ` Konrad Rzeszutek Wilk
2011-05-03 15:43   ` Ian Campbell
2011-05-03 15:43   ` Marek Marczykowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).