All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "scsi: fix upper bounds check of sense key in scsi_sense_key_string()" has been added to the 4.7-stable tree
@ 2016-09-12 15:18 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-09-12 15:18 UTC (permalink / raw)
  To: tyreld, bart.vanassche, gregkh, martin.petersen; +Cc: stable, stable-commits


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

    scsi: fix upper bounds check of sense key in scsi_sense_key_string()

to the 4.7-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-fix-upper-bounds-check-of-sense-key-in-scsi_sense_key_string.patch
and it can be found in the queue-4.7 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 a87eeb900dbb9f8202f96604d56e47e67c936b9d Mon Sep 17 00:00:00 2001
From: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Date: Fri, 12 Aug 2016 17:20:07 -0500
Subject: scsi: fix upper bounds check of sense key in scsi_sense_key_string()

From: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>

commit a87eeb900dbb9f8202f96604d56e47e67c936b9d upstream.

Commit 655ee63cf371 ("scsi constants: command, sense key + additional
sense string") added a "Completed" sense string with key 0xF to
snstext[], but failed to updated the upper bounds check of the sense key
in scsi_sense_key_string().

Fixes: 655ee63cf371 ("[SCSI] scsi constants: command, sense key + additional sense strings")
Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/scsi/constants.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -361,8 +361,9 @@ static const char * const snstext[] = {
 
 /* Get sense key string or NULL if not available */
 const char *
-scsi_sense_key_string(unsigned char key) {
-	if (key <= 0xE)
+scsi_sense_key_string(unsigned char key)
+{
+	if (key < ARRAY_SIZE(snstext))
 		return snstext[key];
 	return NULL;
 }


Patches currently in stable-queue which might be from tyreld@linux.vnet.ibm.com are

queue-4.7/scsi-fix-upper-bounds-check-of-sense-key-in-scsi_sense_key_string.patch

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

only message in thread, other threads:[~2016-09-12 15:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-12 15:18 Patch "scsi: fix upper bounds check of sense key in scsi_sense_key_string()" has been added to the 4.7-stable tree gregkh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.