Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1639080 > unrolled thread
| Started by | Long Li <longli@exchange.microsoft.com> |
|---|---|
| First post | 2017-05-10 23:10 +0200 |
| Last post | 2017-05-10 23:10 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH] scsi: zero per-cmd driver data for each MQ I/O Long Li <longli@exchange.microsoft.com> - 2017-05-10 23:10 +0200
| From | Long Li <longli@exchange.microsoft.com> |
|---|---|
| Date | 2017-05-10 23:10 +0200 |
| Subject | [PATCH] scsi: zero per-cmd driver data for each MQ I/O |
| Message-ID | <tFH1T-5IU-7@gated-at.bofh.it> |
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> --- 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
Back to top | Article view | linux.kernel
csiph-web