drivers/block/xen-blkback: preq.dev is used without initialized
Subsystems (2)
PATCH 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).
--- drivers/block/xen-blkback/blkback.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/block/xen-blkback/blkback.c +2 -1
@@ -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
Quoted 3 lines · Chen Gang
if call
xen_vbd_translatefailed, the preq.dev will be not initialized. so useblkif->vbd.pdeviceinstead (still better to print relative info).
preq.dev is initialized a a couple of lines prior to calling xen_vbd_translate:
preq.dev = req->u.rw.handle;
Quoted 20 lines
Signed-off-by Chen Gang <[email protected]>--- drivers/block/xen-blkback/blkback.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)drivers/block/xen-blkback/blkback.c +2
-1@@ -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; }
Quoted 6 lines
Quoted 1 line
Quoted 1 line · Chen Gang
if call
xen_vbd_translatefailed, the preq.dev will be not initialized. so useblkif->vbd.pdeviceinstead (still better to print relative info).Signed-off-by Chen Gang <[email protected]>
Quoted 21 lines
--- drivers/block/xen-blkback/blkback.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)drivers/block/xen-blkback/blkback.c +2
-1@@ -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
Quoted 6 lines
Quoted 1 line
Quoted 1 line · Chen Gang
if call
xen_vbd_translatefailed, the preq.dev will be not initialized. so useblkif->vbd.pdeviceinstead (still better to print relative info).Signed-off-by Chen Gang <[email protected]>
Quoted 21 lines
--- drivers/block/xen-blkback/blkback.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)drivers/block/xen-blkback/blkback.c +2
-1@@ -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
Quoted 3 lines
Quoted 1 line
Quoted 1 line · Chen Gang
if call
xen_vbd_translatefailed, the preq.dev will be not initialized. so useblkif->vbd.pdeviceinstead (still better to print relative info).
You also could have mentioned that even 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.
Jan
Quoted 22 lines
Signed-off-by Chen Gang <[email protected]>--- drivers/block/xen-blkback/blkback.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)drivers/block/xen-blkback/blkback.c +2
-1@@ -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
Quoted 3 lines
Quoted 1 line
Quoted 1 line · Chen Gang
if call
xen_vbd_translatefailed, the preq.dev will be not initialized. so useblkif->vbd.pdeviceinstead (still better to print relative info).
You also could have mentioned that even 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.
Jan
Quoted 22 lines
Signed-off-by Chen Gang <[email protected]>--- drivers/block/xen-blkback/blkback.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)drivers/block/xen-blkback/blkback.c +2
-1@@ -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
Quoted 10 lines
Quoted 1 line
Quoted 1 line · Roger Pau Monné
Quoted 3 lines · Chen Gang
if call
xen_vbd_translatefailed, the preq.dev will be not initialized. so useblkif->vbd.pdeviceinstead (still better to print relative info).preq.dev is initialized a a couple of lines prior to calling
xen_vbd_translate:preq.dev =
req->u.rw.handle;
Not anymore after 01c681d4c70d64cb72142a2823f27c4146a02e63 (in Konrad's tree).
Jan
Quoted 4 lines · Jan Beulich
You also could have mentioned that even before commit
01c681d4c70d64cb72142a2823f27c4146a02e63the value printed here was bogus, as it was the guest provided value fromreq->u.rw.handlerather than the actual device.
pardon ?
I guess what you said is :
my patch seems ok, but the comments need improving. need add "additional info" in comments:
"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".
is it correct ?
thanks.
Signature · 8 lines
Chen Gang Asianux Corporation _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Quoted 4 lines · Jan Beulich
You also could have mentioned that even before commit
01c681d4c70d64cb72142a2823f27c4146a02e63the value printed here was bogus, as it was the guest provided value fromreq->u.rw.handlerather than the actual device.
pardon ?
I guess what you said is :
my patch seems ok, but the comments need improving. need add "additional info" in comments:
"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".
is it correct ?
thanks.
Signature · 3 lines
Chen Gang Asianux Corporation
Quoted 17 lines
Quoted 1 line
Quoted 1 line · Chen Gang
Quoted 4 lines · Jan Beulich
You also could have mentioned that even before commit
01c681d4c70d64cb72142a2823f27c4146a02e63the value printed here was bogus, as it was the guest provided value fromreq->u.rw.handlerather than the actual device.pardon ?
I guess what you said is :
my patch seems ok, but the comments need improving. need add "additional info" in comments:
"before commit01c681d4c70d64cb72142a2823f27c4146a02e63
the value printed here was bogus, as it was the guest provided value fromreq->u.rw.handlerather than the actual device".
Quoted 1 line
is it correct ?
Yes (and you might have missed the ACK that I had already sent before this reply - that mail got bounced for your address).
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 17 lines
Quoted 1 line
Quoted 1 line · Chen Gang
Quoted 4 lines · Jan Beulich
You also could have mentioned that even before commit
01c681d4c70d64cb72142a2823f27c4146a02e63the value printed here was bogus, as it was the guest provided value fromreq->u.rw.handlerather than the actual device.pardon ?
I guess what you said is :
my patch seems ok, but the comments need improving. need add "additional info" in comments:
"before commit01c681d4c70d64cb72142a2823f27c4146a02e63
the value printed here was bogus, as it was the guest provided value fromreq->u.rw.handlerather than the actual device".
Quoted 1 line
is it correct ?
Yes (and you might have missed the ACK that I had already sent before this reply - that mail got bounced for your address).
Jan
Quoted 17 lines · Jan Beulich
Quoted 17 lines
Quoted 1 line
Quoted 1 line · Chen Gang
Quoted 4 lines · Jan Beulich
You also could have mentioned that even before commit
01c681d4c70d64cb72142a2823f27c4146a02e63the value printed here was bogus, as it was the guest provided value fromreq->u.rw.handlerather than the actual device.pardon ?
I guess what you said is :
my patch seems ok, but the comments need improving. need add "additional info" in comments:
"before commit01c681d4c70d64cb72142a2823f27c4146a02e63
the value printed here was bogus, as it was the guest provided value fromreq->u.rw.handlerather than the actual device".
Quoted 4 lines
Quoted 1 line
is it correct ?
Yes (and you might have missed the ACK that I had already sent before this reply - that mail got bounced for your address).
Yup. Chen, could you respin the patch with the extra comment and the Ack from Jan please?
Thank you!
Quoted 2 lines
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 17 lines · Jan Beulich
Quoted 17 lines
Quoted 1 line
Quoted 1 line · Chen Gang
Quoted 4 lines · Jan Beulich
You also could have mentioned that even before commit
01c681d4c70d64cb72142a2823f27c4146a02e63the value printed here was bogus, as it was the guest provided value fromreq->u.rw.handlerather than the actual device.pardon ?
I guess what you said is :
my patch seems ok, but the comments need improving. need add "additional info" in comments:
"before commit01c681d4c70d64cb72142a2823f27c4146a02e63
the value printed here was bogus, as it was the guest provided value fromreq->u.rw.handlerather than the actual device".
Quoted 4 lines
Quoted 1 line
is it correct ?
Yes (and you might have missed the ACK that I had already sent before this reply - that mail got bounced for your address).
Yup. Chen, could you respin the patch with the extra comment and the Ack from Jan please?
Thank you!
Quoted 2 lines
Jan
Quoted 6 lines · Konrad Rzeszutek Wilk
Quoted 3 lines · Jan Beulich
Quoted 3 lines
Yes (and you might have missed the ACK that I had already sent before this reply - that mail got bounced for your address).
Yup. Chen, could you respin the patch with the extra comment and the Ack from Jan please?
ok, I will send patch v2.
:-)
Signature · 8 lines
Chen Gang Asianux Corporation _______________________________________________ Xen-devel mailing list [email protected] http://lists.xen.org/xen-devel
Quoted 6 lines · Konrad Rzeszutek Wilk
Quoted 3 lines · Jan Beulich
Quoted 3 lines
Yes (and you might have missed the ACK that I had already sent before this reply - that mail got bounced for your address).
Yup. Chen, could you respin the patch with the extra comment and the Ack from Jan please?
ok, I will send patch v2.
:-)
Signature · 3 lines
Chen Gang Asianux Corporation