* Patch "scsi: sg: fix SG_DXFER_FROM_DEV transfers" has been added to the 4.12-stable tree
@ 2017-08-07 20:32 gregkh
2017-08-08 11:42 ` Chris Clayton
0 siblings, 1 reply; 6+ messages in thread
From: gregkh @ 2017-08-07 20:32 UTC (permalink / raw)
To: jthumshirn, chris2553, dgilbert, gregkh, hare, martin.petersen
Cc: stable, stable-commits
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 <stable@vger.kernel.org> know about it.
>From 68c59fcea1f2c6a54c62aa896cc623c1b5bc9b47 Mon Sep 17 00:00:00 2001
From: Johannes Thumshirn <jthumshirn@suse.de>
Date: Fri, 7 Jul 2017 10:56:38 +0200
Subject: scsi: sg: fix SG_DXFER_FROM_DEV transfers
From: Johannes Thumshirn <jthumshirn@suse.de>
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")
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Fixes: 28676d869bbb ("scsi: sg: check for valid direction before starting the request")
Reported-by: Chris Clayton <chris2553@googlemail.com>
Tested-by: Chris Clayton <chris2553@googlemail.com>
Cc: Douglas Gilbert <dgilbert@interlog.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Tested-by: Chris Clayton <chris2553@googlemail.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/scsi/sg.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -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 jthumshirn@suse.de are
queue-4.12/scsi-sg-fix-sg_dxfer_from_dev-transfers.patch
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Patch "scsi: sg: fix SG_DXFER_FROM_DEV transfers" has been added to the 4.12-stable tree
2017-08-07 20:32 Patch "scsi: sg: fix SG_DXFER_FROM_DEV transfers" has been added to the 4.12-stable tree gregkh
@ 2017-08-08 11:42 ` Chris Clayton
2017-08-08 12:20 ` Johannes Thumshirn
0 siblings, 1 reply; 6+ messages in thread
From: Chris Clayton @ 2017-08-08 11:42 UTC (permalink / raw)
To: gregkh, jthumshirn, dgilbert, hare, martin.petersen
Cc: stable, stable-commits
On 07/08/17 21:32, gregkh@linuxfoundation.org wrote:
>
> 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 <stable@vger.kernel.org> 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.
>
> From 68c59fcea1f2c6a54c62aa896cc623c1b5bc9b47 Mon Sep 17 00:00:00 2001
> From: Johannes Thumshirn <jthumshirn@suse.de>
> Date: Fri, 7 Jul 2017 10:56:38 +0200
> Subject: scsi: sg: fix SG_DXFER_FROM_DEV transfers
>
> From: Johannes Thumshirn <jthumshirn@suse.de>
>
> 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")
>
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> Fixes: 28676d869bbb ("scsi: sg: check for valid direction before starting the request")
> Reported-by: Chris Clayton <chris2553@googlemail.com>
> Tested-by: Chris Clayton <chris2553@googlemail.com>
> Cc: Douglas Gilbert <dgilbert@interlog.com>
> Reviewed-by: Hannes Reinecke <hare@suse.com>
> Tested-by: Chris Clayton <chris2553@googlemail.com>
> Acked-by: Douglas Gilbert <dgilbert@interlog.com>
> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> ---
> drivers/scsi/sg.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> --- a/drivers/scsi/sg.c
> +++ b/drivers/scsi/sg.c
> @@ -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 jthumshirn@suse.de are
>
> queue-4.12/scsi-sg-fix-sg_dxfer_from_dev-transfers.patch
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Patch "scsi: sg: fix SG_DXFER_FROM_DEV transfers" has been added to the 4.12-stable tree
2017-08-08 11:42 ` Chris Clayton
@ 2017-08-08 12:20 ` Johannes Thumshirn
2017-08-08 14:39 ` James Bottomley
2017-08-08 16:16 ` Greg KH
0 siblings, 2 replies; 6+ messages in thread
From: Johannes Thumshirn @ 2017-08-08 12:20 UTC (permalink / raw)
To: Chris Clayton, gregkh, James Bottomley
Cc: gregkh, dgilbert, hare, martin.petersen, stable, stable-commits
On Tue, Aug 08, 2017 at 12:42:17PM +0100, Chris Clayton wrote:
> On 07/08/17 21:32, gregkh@linuxfoundation.org wrote:
> >
> > 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 <stable@vger.kernel.org> 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.
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
--
Johannes Thumshirn Storage
jthumshirn@suse.de +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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Patch "scsi: sg: fix SG_DXFER_FROM_DEV transfers" has been added to the 4.12-stable tree
2017-08-08 12:20 ` Johannes Thumshirn
@ 2017-08-08 14:39 ` James Bottomley
2017-08-09 6:32 ` Johannes Thumshirn
2017-08-08 16:16 ` Greg KH
1 sibling, 1 reply; 6+ messages in thread
From: James Bottomley @ 2017-08-08 14:39 UTC (permalink / raw)
To: Johannes Thumshirn, Chris Clayton, gregkh
Cc: dgilbert, hare, martin.petersen, stable, stable-commits
On Tue, 2017-08-08 at 14:20 +0200, Johannes Thumshirn wrote:
> On Tue, Aug 08, 2017 at 12:42:17PM +0100, Chris Clayton wrote:
> >
> > On 07/08/17 21:32, gregkh@linuxfoundation.org wrote:
> > >
> > >
> > > 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-q
> > > ueue.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 <stable@vger.kernel.org> 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.
>
> 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
> James any plans in doing otherwise?
> Greg is this acceptible for you?
>
> Thanks,
> Johannes
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Patch "scsi: sg: fix SG_DXFER_FROM_DEV transfers" has been added to the 4.12-stable tree
2017-08-08 12:20 ` Johannes Thumshirn
2017-08-08 14:39 ` James Bottomley
@ 2017-08-08 16:16 ` Greg KH
1 sibling, 0 replies; 6+ messages in thread
From: Greg KH @ 2017-08-08 16:16 UTC (permalink / raw)
To: Johannes Thumshirn
Cc: Chris Clayton, James Bottomley, dgilbert, hare, martin.petersen,
stable, stable-commits
On Tue, Aug 08, 2017 at 02:20:22PM +0200, Johannes Thumshirn wrote:
> On Tue, Aug 08, 2017 at 12:42:17PM +0100, Chris Clayton wrote:
> > On 07/08/17 21:32, gregkh@linuxfoundation.org wrote:
> > >
> > > 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 <stable@vger.kernel.org> 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.
>
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Patch "scsi: sg: fix SG_DXFER_FROM_DEV transfers" has been added to the 4.12-stable tree
2017-08-08 14:39 ` James Bottomley
@ 2017-08-09 6:32 ` Johannes Thumshirn
0 siblings, 0 replies; 6+ messages in thread
From: Johannes Thumshirn @ 2017-08-09 6:32 UTC (permalink / raw)
To: James Bottomley
Cc: Chris Clayton, gregkh, dgilbert, hare, martin.petersen, stable,
stable-commits
On Tue, Aug 08, 2017 at 07:39:12AM -0700, James Bottomley wrote:
> 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
--
Johannes Thumshirn Storage
jthumshirn@suse.de +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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-08-09 6:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-07 20:32 Patch "scsi: sg: fix SG_DXFER_FROM_DEV transfers" has been added to the 4.12-stable tree gregkh
2017-08-08 11:42 ` Chris Clayton
2017-08-08 12:20 ` Johannes Thumshirn
2017-08-08 14:39 ` James Bottomley
2017-08-09 6:32 ` Johannes Thumshirn
2017-08-08 16:16 ` Greg KH
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).