From: Long Li <longli@microsoft.com>
To: Long Li <longli@microsoft.com>,
"James E.J. Bottomley" <jejb@linux.vnet.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: KY Srinivasan <kys@microsoft.com>,
Stephen Hemminger <sthemmin@microsoft.com>
Subject: RE: [PATCH] scsi: zero per-cmd driver data for each MQ I/O
Date: Mon, 15 May 2017 22:48:13 +0000 [thread overview]
Message-ID: <MWHPR03MB3136FC54E76FBFD54A178159CEE10@MWHPR03MB3136.namprd03.prod.outlook.com> (raw)
In-Reply-To: <1494450443-2921-1-git-send-email-longli@exchange.microsoft.com>
> -----Original Message-----
> From: Long Li [mailto:longli@exchange.microsoft.com]
> Sent: Wednesday, May 10, 2017 2:07 PM
> To: James E.J. Bottomley <jejb@linux.vnet.ibm.com>; Martin K. Petersen
> <martin.petersen@oracle.com>; linux-scsi@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Cc: Long Li <longli@microsoft.com>
> Subject: [PATCH] scsi: zero per-cmd driver data for each MQ I/O
>
> From: Long Li <longli@microsoft.com>
>
> Lower layer driver may not initialize private data before use. Zero them out
> to prevent use of stale data.
>
> Signed-off-by: Long Li <longli@microsoft.com>
Can someone help review this patch?
> ---
> drivers/scsi/scsi_lib.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index
> 19125d7..a821593 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -1850,7 +1850,7 @@ static int scsi_mq_prep_fn(struct request *req)
>
> /* zero out the cmd, except for the embedded scsi_request */
> memset((char *)cmd + sizeof(cmd->req), 0,
> - sizeof(*cmd) - sizeof(cmd->req));
> + sizeof(*cmd) - sizeof(cmd->req) +
> + shost->hostt->cmd_size);
>
> req->special = cmd;
>
> --
> 2.7.4
next prev parent reply other threads:[~2017-05-15 22:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-10 21:07 [PATCH] scsi: zero per-cmd driver data for each MQ I/O Long Li
2017-05-15 22:48 ` Long Li [this message]
2017-05-15 23:20 ` KY Srinivasan
2017-05-15 23:02 ` [Possible Phish Fraud][PATCH] " Bart Van Assche
2017-05-18 6:55 ` [PATCH] " Christoph Hellwig
2017-05-15 23:32 Long Li
2017-05-16 0:00 ` Bart Van Assche
2017-05-16 17:31 ` Long Li
2017-05-17 23:05 ` Bart Van Assche
2017-05-18 6:54 ` Christoph Hellwig
2017-05-18 13:29 ` KY Srinivasan
2017-05-18 15:52 ` Bart Van Assche
2017-05-18 16:47 ` Long Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=MWHPR03MB3136FC54E76FBFD54A178159CEE10@MWHPR03MB3136.namprd03.prod.outlook.com \
--to=longli@microsoft.com \
--cc=jejb@linux.vnet.ibm.com \
--cc=kys@microsoft.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sthemmin@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.