This is a note to let you know that I've just added the patch titled scsi: fix random memory corruption with scsi-mq + T10 PI 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-fix-random-memory-corruption-with-scsi-mq-t10-pi.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@xxxxxxxxxxxxxxx> know about it. >From 120bb3e1e36da9c1ae6b978c825a28b944a5d7c5 Mon Sep 17 00:00:00 2001 From: Tony Battersby <tonyb@xxxxxxxxxxxxxxx> Date: Mon, 8 Dec 2014 17:20:52 -0500 Subject: scsi: fix random memory corruption with scsi-mq + T10 PI From: Tony Battersby <tonyb@xxxxxxxxxxxxxxx> commit 120bb3e1e36da9c1ae6b978c825a28b944a5d7c5 upstream. This fixes random memory corruption triggered when all three of the following are true: * scsi-mq enabled * T10 Protection Information (DIF) enabled * SCSI host with sg_tablesize > SCSI_MAX_SG_SEGMENTS (128) The symptoms of this bug are unpredictable memory corruption, BUG()s, oopses, lockups, etc., any of which may appear to be completely unrelated to the root cause. Signed-off-by: Tony Battersby <tonyb@xxxxxxxxxxxxxxx> Reviewed-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx> Signed-off-by: Christoph Hellwig <hch@xxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/scsi/scsi_lib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1829,7 +1829,9 @@ static int scsi_mq_prep_fn(struct reques if (scsi_host_get_prot(shost)) { cmd->prot_sdb = (void *)sg + - shost->sg_tablesize * sizeof(struct scatterlist); + min_t(unsigned int, + shost->sg_tablesize, SCSI_MAX_SG_SEGMENTS) * + sizeof(struct scatterlist); memset(cmd->prot_sdb, 0, sizeof(struct scsi_data_buffer)); cmd->prot_sdb->table.sgl = Patches currently in stable-queue which might be from tonyb@xxxxxxxxxxxxxxx are queue-3.18/scsi-fix-random-memory-corruption-with-scsi-mq-t10-pi.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html