Patch "scsi: sg: fix SG_DXFER_FROM_DEV transfers" has been added to the 4.12-stable tree
Subsystems (3)
This is a note to let you know that I've just added the patch titled
scsi: sg: fix SG_DXFER_FROM_DEV transfers
to the 4.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
scsi-sg-fix-sg_dxfer_from_dev-transfers.patch
and it can be found in the queue-4.12 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
68c59fcea1f2c6a54c62aa896cc623c1b5bc9b47Mon Sep 17 00:00:00 2001
From: Johannes Thumshirn <[email protected]>
Date: Fri, 7 Jul 2017 10:56:38 +0200
Subject: scsi: sg: fix SG_DXFER_FROM_DEV transfers
From: Johannes Thumshirn <[email protected]>
commit 68c59fcea1f2c6a54c62aa896cc623c1b5bc9b47 upstream.
SG_DXFER_FROM_DEV transfers do not necessarily have a dxferp as we set it to NULL for the old sg_io read/write interface, but must have a length bigger than 0. This fixes a regression introduced by commit 28676d869bbb ("scsi: sg: check for valid direction before starting the request")
--- drivers/scsi/sg.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/scsi/sg.c +4 -1
@@ -758,8 +758,11 @@ static bool sg_is_valid_dxfer(sg_io_hdr_if (hp->dxferp || hp->dxfer_len >0 )return false;return true; -case SG_DXFER_TO_DEV :case SG_DXFER_FROM_DEV : +if (hp->dxfer_len <0 ) +return false; +return true; +case SG_DXFER_TO_DEV :case SG_DXFER_TO_FROM_DEV :if (!hp->dxferp || hp->dxfer_len ==0 )return false;
Patches currently in stable-queue which might be from [email protected] are
queue-4.12/scsi-sg-fix-sg_dxfer_from_dev-transfers.patch
Quoted 8 lines · On 07/08/17 21:32, [email protected] wrote:
This is a note to let you know that I've just added the patch titled
scsi: sg: fix
SG_DXFER_FROM_DEVtransfersto the 4.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
Quoted 7 lines
The filename of the patch is:
scsi-sg-fix-sg_dxfer_from_dev-transfers.patch
and it can be found in the queue-4.12 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Johannes' commit message says that the transfer must have a length bigger than 0, so the code should return false if the length is less than or equal to 0, but the test is for less than 0.
But in any case, there's another patch that removes all this sg_is_valid_dxfer() jiggery-pokery and replaces it with a simpler test. It hasn't reached Linus' tree yet but is, I believe, cc'd to stable.
Quoted 52 lines
From
68c59fcea1f2c6a54c62aa896cc623c1b5bc9b47Mon Sep 17 00:00:00 2001
From: Johannes Thumshirn <[email protected]>
Date: Fri, 7 Jul 2017 10:56:38 +0200
Subject: scsi: sg: fixSG_DXFER_FROM_DEVtransfersFrom: Johannes Thumshirn <[email protected]>
commit
68c59fcea1f2c6a54c62aa896cc623c1b5bc9b47upstream.
SG_DXFER_FROM_DEVtransfers do not necessarily have a dxferp as we set it to NULL for the oldsg_ioread/write interface, but must have a length bigger than 0. This fixes a regression introduced by commit28676d869bbb("scsi: sg: check for valid direction before starting the request")Signed-off-by Johannes Thumshirn <[email protected]>Fixes 28676d869bbb ("scsi: sg: check for valid direction before starting the request")Reported-by Chris Clayton <[email protected]>Tested-by Chris Clayton <[email protected]>Cc Douglas Gilbert <[email protected]>Reviewed-by Hannes Reinecke <[email protected]>Tested-by Chris Clayton <[email protected]>Acked-by Douglas Gilbert <[email protected]>Signed-off-by Martin K. Petersen <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/scsi/sg.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/scsi/sg.c +4
-1@@ -758,8 +758,11 @@ static bool sg_is_valid_dxfer(sg_io_hdr_if (hp->dxferp || hp->dxfer_len >0 )return false;return true; -case SG_DXFER_TO_DEV :case SG_DXFER_FROM_DEV : +if (hp->dxfer_len <0 ) +return false; +return true; +case SG_DXFER_TO_DEV :case SG_DXFER_TO_FROM_DEV :if (!hp->dxferp || hp->dxfer_len ==0 )return false;Patches currently in stable-queue which might be from [email protected] are
queue-4.12/scsi-sg-fix-sg_dxfer_from_dev-transfers.patch
Quoted 17 lines · Chris Clayton
Quoted 8 lines · On 07/08/17 21:32, [email protected] wrote:
This is a note to let you know that I've just added the patch titled
scsi: sg: fix
SG_DXFER_FROM_DEVtransfersto the 4.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summaryQuoted 7 lines
The filename of the patch is:
scsi-sg-fix-sg_dxfer_from_dev-transfers.patch
and it can be found in the queue-4.12 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 5 lines
Johannes' commit message says that the transfer must have a length bigger than 0, so the code should return false if the length is less than or equal to 0, but the test is for less than 0.
But in any case, there's another patch that removes all this
sg_is_valid_dxfer()jiggery-pokery and replaces it with a simpler test. It hasn't reached Linus' tree yet but is, I believe, cc'd to stable.
Yup, I hope James is sending it out for this weekend's -rc and then it should be backported to stable instead.
James any plans in doing otherwise?
Greg is this acceptible for you?
Thanks,
Johannes
Signature · 6 lines
Johannes Thumshirn Storage [email protected] +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N�rnberg GF: Felix Imend�rffer, Jane Smithard, Graham Norton HRB 21284 (AG N�rnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Quoted 27 lines · Johannes Thumshirn
Quoted 26 lines · Chris Clayton
Quoted 11 lines · On 07/08/17 21:32, [email protected] wrote:
This is a note to let you know that I've just added the patch titled
scsi: sg: fix
SG_DXFER_FROM_DEVtransfersto the 4.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-q
ueue.git;a=summaryQuoted 8 lines
The filename of the patch is:
scsi-sg-fix-sg_dxfer_from_dev-transfers.patch and it can be found in the queue-4.12 subdirectory.If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.Johannes' commit message says that the transfer must have a length bigger than 0, so the code should return false if the length is less than or equal to 0, but the test is for less than 0.
Quoted 7 lines
Quoted 4 lines
But in any case, there's another patch that removes all this
sg_is_valid_dxfer()jiggery-pokery and replaces it with a simpler test. It hasn't reached Linus' tree yet but is, I believe, cc'd to stable.Yup, I hope James is sending it out for this weekend's -rc and then it should be backported to stable instead.
I'm not sure which patch you mean. However, if you got one of my automated emails about it then it will be in today's batch for Linus.
James
Quoted 5 lines
James any plans in doing otherwise?
Greg is this acceptible for you?Thanks,
Johannes
Quoted 2 lines · James Bottomley
I'm not sure which patch you mean. �However, if you got one of my automated emails about it then it will be in today's batch for Linus.
Yup it was (FTR I was talking about f930c7043663 scsi: sg: only check for dxfer_len greater than 256M) and is it in Linus' tree now.
Thanks a lot,
Johannes
Signature · 6 lines
Johannes Thumshirn Storage [email protected] +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N�rnberg GF: Felix Imend�rffer, Jane Smithard, Graham Norton HRB 21284 (AG N�rnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Greg KH
maintainerQuoted 21 lines · Johannes Thumshirn
Quoted 20 lines · Chris Clayton
Quoted 8 lines · On 07/08/17 21:32, [email protected] wrote:
This is a note to let you know that I've just added the patch titled
scsi: sg: fix
SG_DXFER_FROM_DEVtransfersto the 4.12-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summaryQuoted 7 lines
The filename of the patch is:
scsi-sg-fix-sg_dxfer_from_dev-transfers.patch
and it can be found in the queue-4.12 subdirectory.If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Johannes' commit message says that the transfer must have a length bigger than 0, so the code should return false if the length is less than or equal to 0, but the test is for less than 0.
Quoted 8 lines
Quoted 2 lines
But in any case, there's another patch that removes all this
sg_is_valid_dxfer()jiggery-pokery and replaces it with a simpler test. It hasn't reached Linus' tree yet but is, I believe, cc'd to stable.Yup, I hope James is sending it out for this weekend's -rc and then it should be backported to stable instead.
James any plans in doing otherwise?
Greg is this acceptible for you?
That's fine, I'll queue it up when it lands in a released -rc.
thanks,
greg k-h