stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "scsi: sg: Re-fix off by one in sg_fill_request_table()" has been added to the 3.18-stable tree
@ 2017-10-30  9:28 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-10-30  9:28 UTC (permalink / raw)
  To: ben.hutchings, dgilbert, gregkh, martin.petersen; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    scsi: sg: Re-fix off by one in sg_fill_request_table()

to the 3.18-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-re-fix-off-by-one-in-sg_fill_request_table.patch
and it can be found in the queue-3.18 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 587c3c9f286cee5c9cac38d28c8ae1875f4ec85b Mon Sep 17 00:00:00 2001
From: Ben Hutchings <ben.hutchings@codethink.co.uk>
Date: Sun, 15 Oct 2017 18:16:33 +0100
Subject: scsi: sg: Re-fix off by one in sg_fill_request_table()

From: Ben Hutchings <ben.hutchings@codethink.co.uk>

commit 587c3c9f286cee5c9cac38d28c8ae1875f4ec85b upstream.

Commit 109bade9c625 ("scsi: sg: use standard lists for sg_requests")
introduced an off-by-one error in sg_ioctl(), which was fixed by commit
bd46fc406b30 ("scsi: sg: off by one in sg_ioctl()").

Unfortunately commit 4759df905a47 ("scsi: sg: factor out
sg_fill_request_table()") moved that code, and reintroduced the
bug (perhaps due to a botched rebase).  Fix it again.

Fixes: 4759df905a47 ("scsi: sg: factor out sg_fill_request_table()")
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
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 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -863,7 +863,7 @@ sg_fill_request_table(Sg_fd *sfp, sg_req
 
 	val = 0;
 	list_for_each_entry(srp, &sfp->rq_list, entry) {
-		if (val > SG_MAX_QUEUE)
+		if (val >= SG_MAX_QUEUE)
 			break;
 		rinfo[val].req_state = srp->done + 1;
 		rinfo[val].problem =


Patches currently in stable-queue which might be from ben.hutchings@codethink.co.uk are

queue-3.18/scsi-sg-re-fix-off-by-one-in-sg_fill_request_table.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-30  9:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-30  9:28 Patch "scsi: sg: Re-fix off by one in sg_fill_request_table()" has been added to the 3.18-stable tree gregkh

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).