Skip to contentSkip to conversation

drivers/block/xen-blkback: preq.dev is used without initialized

PATCH In review Chen Gang 4 participants 19 messages Feb 28, 2013 – Apr 3, 2013

Subsystems (2)
lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH v2 1/1 drivers/block/xen-blkback: preq.dev is used without initialized

if call xen_vbd_translate failed, the preq.dev will be not initialized. so use blkif->vbd.pdevice instead (still better to print relative info).

additional information:
before commit 01c681d4c70d64cb72142a2823f27c4146a02e63, the value printed here was bogus, as it was the guest provided value from req->u.rw.handle rather than the actual device.

---
 drivers/block/xen-blkback/blkback.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/block/xen-blkback/blkback.c +2 -1
index de1f319..6d1cc3d 100644
@@ -904,7 +904,8 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
 		pr_debug(DRV_PFX "access denied: %s of [%llu,%llu] on dev=%04x\n",
 			 operation == READ ? "read" : "write",
 			 preq.sector_number,
-			 preq.sector_number + preq.nr_sects, preq.dev);
+			 preq.sector_number + preq.nr_sects,
+			 blkif->vbd.pdevice);
 		goto fail_response;
 	}
 
Signature · 1 line
1.7.7.6
#1 lore raw
Quoted 8 lines · Chen Gang

if call xen_vbd_translate failed, the preq.dev will be not initialized. so use blkif->vbd.pdevice instead (still better to print relative info).

additional information:
before commit 01c681d4c70d64cb72142a2823f27c4146a02e63, the value printed here was bogus, as it was the guest provided value from req->u.rw.handle rather than the actual device.

applied with some changes to the description.

Quoted 23 lines
---
 drivers/block/xen-blkback/blkback.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/block/xen-blkback/blkback.c +2 -1
index de1f319..6d1cc3d 100644
@@ -904,7 +904,8 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
 		pr_debug(DRV_PFX "access denied: %s of [%llu,%llu] on dev=%04x\n",
 			 operation == READ ? "read" : "write",
 			 preq.sector_number,
-			 preq.sector_number + preq.nr_sects, preq.dev);
+			 preq.sector_number + preq.nr_sects,
+			 blkif->vbd.pdevice);
 		goto fail_response;
 	}
 
Signature · 1 line
1.7.7.6
#2 lore raw
In reply to Chen Gang
Quoted 8 lines · Chen Gang

if call xen_vbd_translate failed, the preq.dev will be not initialized. so use blkif->vbd.pdevice instead (still better to print relative info).

additional information:
before commit 01c681d4c70d64cb72142a2823f27c4146a02e63, the value printed here was bogus, as it was the guest provided value from req->u.rw.handle rather than the actual device.

applied with some changes to the description.

Quoted 23 lines
---
 drivers/block/xen-blkback/blkback.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/block/xen-blkback/blkback.c +2 -1
index de1f319..6d1cc3d 100644
@@ -904,7 +904,8 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
 		pr_debug(DRV_PFX "access denied: %s of [%llu,%llu] on dev=%04x\n",
 			 operation == READ ? "read" : "write",
 			 preq.sector_number,
-			 preq.sector_number + preq.nr_sects, preq.dev);
+			 preq.sector_number + preq.nr_sects,
+			 blkif->vbd.pdevice);
 		goto fail_response;
 	}
 
Signature · 1 line
1.7.7.6
author
#3 lore raw
Quoted 5 lines · Konrad Rzeszutek Wilk
Quoted 4 lines · Chen Gang

if call xen_vbd_translate failed, the preq.dev will be not initialized. so use blkif->vbd.pdevice instead (still better to print relative info).

Quoted 7 lines
Quoted 4 lines

additional information:
before commit 01c681d4c70d64cb72142a2823f27c4146a02e63, the value printed here was bogus, as it was the guest provided value from req->u.rw.handle rather than the actual device.

applied with some changes to the description.

thanks.

Quoted 25 lines
Quoted 23 lines
---
 drivers/block/xen-blkback/blkback.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/block/xen-blkback/blkback.c +2 -1
index de1f319..6d1cc3d 100644
@@ -904,7 +904,8 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
 		pr_debug(DRV_PFX "access denied: %s of [%llu,%llu] on dev=%04x\n",
 			 operation == READ ? "read" : "write",
 			 preq.sector_number,
-			 preq.sector_number + preq.nr_sects, preq.dev);
+			 preq.sector_number + preq.nr_sects,
+			 blkif->vbd.pdevice);
 		goto fail_response;
 	}
 
Signature · 1 line
1.7.7.6
Signature · 8 lines
Chen Gang

Asianux Corporation

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
author
#4 lore raw
In reply to Konrad Rzeszutek Wilk
Quoted 5 lines · Konrad Rzeszutek Wilk
Quoted 4 lines · Chen Gang

if call xen_vbd_translate failed, the preq.dev will be not initialized. so use blkif->vbd.pdevice instead (still better to print relative info).

Quoted 7 lines
Quoted 4 lines

additional information:
before commit 01c681d4c70d64cb72142a2823f27c4146a02e63, the value printed here was bogus, as it was the guest provided value from req->u.rw.handle rather than the actual device.

applied with some changes to the description.

thanks.

Quoted 25 lines
Quoted 23 lines
---
 drivers/block/xen-blkback/blkback.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/block/xen-blkback/blkback.c +2 -1
index de1f319..6d1cc3d 100644
@@ -904,7 +904,8 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif,
 		pr_debug(DRV_PFX "access denied: %s of [%llu,%llu] on dev=%04x\n",
 			 operation == READ ? "read" : "write",
 			 preq.sector_number,
-			 preq.sector_number + preq.nr_sects, preq.dev);
+			 preq.sector_number + preq.nr_sects,
+			 blkif->vbd.pdevice);
 		goto fail_response;
 	}
 
Signature · 1 line
1.7.7.6
Signature · 3 lines
Chen Gang

Asianux Corporation
#5 lore raw
In reply to Chen Gang

Hello,

Quoted 7 lines · Chen Gang

additional information:
before commit 01c681d4c70d64cb72142a2823f27c4146a02e63, the value printed here was bogus, as it was the guest provided value from req->u.rw.handle rather than the actual device.

Sorry I'm a bit late but since since 01c681d is in stable, I guess a72d900 (xen/xen-blkback: preq.dev is used without initialized) could be added in stable as well.
Am I wrong? otherwise I'm ok to do the request.

Regards,

--
William

#6 lore raw
In reply to Chen Gang

Hello,

Quoted 7 lines · Chen Gang

additional information:
before commit 01c681d4c70d64cb72142a2823f27c4146a02e63, the value printed here was bogus, as it was the guest provided value from req->u.rw.handle rather than the actual device.

Sorry I'm a bit late but since since 01c681d is in stable, I guess a72d900 (xen/xen-blkback: preq.dev is used without initialized) could be added in stable as well.
Am I wrong? otherwise I'm ok to do the request.

Regards,

--
William

#7 lore raw
Quoted 7 lines
Quoted 1 line
Quoted 1 line · William Dauchy
Quoted 5 lines · Chen Gang

additional information:
before commit 01c681d4c70d64cb72142a2823f27c4146a02e63, the value printed here was bogus, as it was the guest provided value from req->u.rw.handle rather than the actual device.

Quoted 7 lines
Quoted 2 lines

Sorry I'm a bit late but since since 01c681d is in stable, I guess a72d900 (xen/xen-blkback: preq.dev is used without initialized) could be added in stable as well.
Am I wrong? otherwise I'm ok to do the request.

Iirc we requested the earlier commit to be removed from stable trees, and I think Greg also did so.

Jan

#18 lore raw
In reply to William Dauchy
Quoted 7 lines
Quoted 1 line
Quoted 1 line · William Dauchy
Quoted 5 lines · Chen Gang

additional information:
before commit 01c681d4c70d64cb72142a2823f27c4146a02e63, the value printed here was bogus, as it was the guest provided value from req->u.rw.handle rather than the actual device.

Quoted 7 lines
Quoted 2 lines

Sorry I'm a bit late but since since 01c681d is in stable, I guess a72d900 (xen/xen-blkback: preq.dev is used without initialized) could be added in stable as well.
Am I wrong? otherwise I'm ok to do the request.

Iirc we requested the earlier commit to be removed from stable trees, and I think Greg also did so.

Jan

#8 lore raw
In reply to Jan Beulich

Hello Jan,

Quoted 2 lines · Jan Beulich

Iirc we requested the earlier commit to be removed from stable trees, and I think Greg also did so.

I'm sorry but I'm unable to find a revert of 01c681d in stable tree.

Regards,
--
William

#9 lore raw
In reply to Jan Beulich

Hello Jan,

Quoted 2 lines · Jan Beulich

Iirc we requested the earlier commit to be removed from stable trees, and I think Greg also did so.

I'm sorry but I'm unable to find a revert of 01c681d in stable tree.

Regards,
--
William

#10 lore raw
Quoted 6 lines
Quoted 1 line
Quoted 1 line · William Dauchy
Quoted 2 lines · Jan Beulich

Iirc we requested the earlier commit to be removed from stable trees, and I think Greg also did so.

I'm sorry but I'm unable to find a revert of 01c681d in stable tree.

ChangeLog-3.8.3 for example has

commit 32f4d10ed8fd7ef4cebbf02c5326e8bb6aeca9b1

Author: Greg Kroah-Hartman <[email protected]>
Date:   Tue Mar 12 15:08:26 2013 -0700

Revert "xen/blkback: Don't trust the handle from the frontend."

This reverts commit 01c681d4c70d64cb72142a2823f27c4146a02e63 upstream (ef56ca64ea733c3b88f0bb74b04da128b1dc35d8 in this tree), as it wasn't supposed to have been applied to the stable tree.

Cc Jan Beulich <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Konrad Rzeszutek Wilk <[email protected]>

Jan

#17 lore raw
In reply to William Dauchy
Quoted 6 lines
Quoted 1 line
Quoted 1 line · William Dauchy
Quoted 2 lines · Jan Beulich

Iirc we requested the earlier commit to be removed from stable trees, and I think Greg also did so.

I'm sorry but I'm unable to find a revert of 01c681d in stable tree.

ChangeLog-3.8.3 for example has

commit 32f4d10ed8fd7ef4cebbf02c5326e8bb6aeca9b1

Author: Greg Kroah-Hartman <[email protected]>
Date:   Tue Mar 12 15:08:26 2013 -0700

Revert "xen/blkback: Don't trust the handle from the frontend."

This reverts commit 01c681d4c70d64cb72142a2823f27c4146a02e63 upstream (ef56ca64ea733c3b88f0bb74b04da128b1dc35d8 in this tree), as it wasn't supposed to have been applied to the stable tree.

Cc Jan Beulich <[email protected]>
Cc Ian Campbell <[email protected]>
Cc Konrad Rzeszutek Wilk <[email protected]>

Jan

#11 lore raw
In reply to Jan Beulich
Quoted 1 line · Jan Beulich

ChangeLog-3.8.3 for example has

oh sorry, you are right. I wasn't looking is the 3.8.x branch. The thing is, the revert seems present only in 3.8.x branch. For example in 3.4.x the last patch is still 01c681d Should we consider this normal or is it a mistake?

--
William

#12 lore raw
In reply to Jan Beulich
Quoted 1 line · Jan Beulich

ChangeLog-3.8.3 for example has

oh sorry, you are right. I wasn't looking is the 3.8.x branch. The thing is, the revert seems present only in 3.8.x branch. For example in 3.4.x the last patch is still 01c681d Should we consider this normal or is it a mistake?

--
William

#13 lore raw
Quoted 8 lines
Quoted 1 line
Quoted 1 line · William Dauchy
Quoted 1 line · Jan Beulich

ChangeLog-3.8.3 for example has

oh sorry, you are right. I wasn't looking is the 3.8.x branch. The thing is, the revert seems present only in 3.8.x branch. For example in 3.4.x the last patch is still 01c681d Should we consider this normal or is it a mistake?

I think it is a mistake, but ultimately it's Konrad's call.

Jan

#16 lore raw
In reply to William Dauchy
Quoted 8 lines
Quoted 1 line
Quoted 1 line · William Dauchy
Quoted 1 line · Jan Beulich

ChangeLog-3.8.3 for example has

oh sorry, you are right. I wasn't looking is the 3.8.x branch. The thing is, the revert seems present only in 3.8.x branch. For example in 3.4.x the last patch is still 01c681d Should we consider this normal or is it a mistake?

I think it is a mistake, but ultimately it's Konrad's call.

Jan

#14 lore raw
In reply to Jan Beulich
Quoted 10 lines · Jan Beulich
Quoted 8 lines
Quoted 1 line
Quoted 1 line · William Dauchy
Quoted 1 line · Jan Beulich

ChangeLog-3.8.3 for example has

oh sorry, you are right. I wasn't looking is the 3.8.x branch. The thing is, the revert seems present only in 3.8.x branch. For example in 3.4.x the last patch is still 01c681d Should we consider this normal or is it a mistake?

I think it is a mistake, but ultimately it's Konrad's call.

It is a mistake. Please revert it if possible.

Quoted 3 lines

Jan

#15 lore raw
In reply to Jan Beulich
Quoted 10 lines · Jan Beulich
Quoted 8 lines
Quoted 1 line
Quoted 1 line · William Dauchy
Quoted 1 line · Jan Beulich

ChangeLog-3.8.3 for example has

oh sorry, you are right. I wasn't looking is the 3.8.x branch. The thing is, the revert seems present only in 3.8.x branch. For example in 3.4.x the last patch is still 01c681d Should we consider this normal or is it a mistake?

I think it is a mistake, but ultimately it's Konrad's call.

It is a mistake. Please revert it if possible.

Quoted 3 lines

Jan