blkfront: fix data size for xenbus_gather in, blkfront_connect
Subsystems (3)
PATCH 1/1 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).
--- drivers/block/xen-blkfront.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/block/xen-blkfront.c +0 -0
@@ -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
[email protected]
http://lists.xensource.com/xen-devel
Quoted 6 lines · Marek Marczykowski
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 <[email protected]>
Good catch.
Quoted 19 lines
--- drivers/block/xen-blkfront.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/block/xen-blkfront.c +1
-1@@ -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 );/*
Quoted 4 lines · Marek Marczykowski
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?
Quoted 28 lines
Signed-off-by Marek Marczykowski <[email protected]>--- drivers/block/xen-blkfront.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/block/xen-blkfront.c +1
-1@@ -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
[email protected]
http://lists.xensource.com/xen-devel
Quoted 19 lines · Konrad Rzeszutek Wilk
Quoted 4 lines · Marek Marczykowski
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?
Quoted 6 lines
Signed-off-by Marek Marczykowski <[email protected]>--- drivers/block/xen-blkfront.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 6 lines
drivers/block/xen-blkfront.c static void blkfront_connect(struct blkfront_info · line 1151
Quoted 6 lines
drivers/block/xen-blkfront.c +0
-0@@ -1151,7 +1151,7 @@ static void blkfront_connect(struct blkfront_info *info)
^ the original path was lined wrapped in at least this spot
Quoted 22 lines
Quoted 12 lines
drivers/block/xen-blkfront.c +1
-1} err =xenbus_gather (XBT_NIL , info->xbdev->otherend, -"feature-barrier" ,"%lu" , &barrier, +"feature-barrier" ,"%d" , &barrier,NULL );/*
Quoted 4 lines
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel
Quoted 6 lines · Konrad Rzeszutek Wilk
Quoted 4 lines · Marek Marczykowski
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).
Quoted 7 lines
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...
Quoted 1 line
Can you send the patch as attachment please?
Sure, attached.
Quoted 28 lines
Quoted 27 lines
Signed-off-by Marek Marczykowski <[email protected]>--- drivers/block/xen-blkfront.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/block/xen-blkfront.c +1
-1@@ -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
[email protected]
http://lists.xensource.com/xen-devel
Signature · 3 lines
Pozdrawiam / Best Regards, Marek Marczykowski | RLU #390519 marmarek at mimuw edu pl | xmpp:marmarek at staszic waw pl
From e1ccf5d4a44013cd8828462d500f6d1a46358cff Mon Sep 17 00:00:00 2001
From: Marek Marczykowski <[email protected]>
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).
--- drivers/block/xen-blkfront.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/block/xen-blkfront.c +1 -1
@@ -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 );/*
Signature · 1 line
1.7.4.4
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel