Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1642110 > unrolled thread

RE: [PATCH] scsi: zero per-cmd driver data for each MQ I/O

Started byLong Li <longli@microsoft.com>
First post2017-05-16 00:50 +0200
Last post2017-05-16 01:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  RE: [PATCH] scsi: zero per-cmd driver data for each MQ I/O Long Li <longli@microsoft.com> - 2017-05-16 00:50 +0200
    RE: [PATCH] scsi: zero per-cmd driver data for each MQ I/O KY Srinivasan <kys@microsoft.com> - 2017-05-16 01:30 +0200

#1642110 — RE: [PATCH] scsi: zero per-cmd driver data for each MQ I/O

FromLong Li <longli@microsoft.com>
Date2017-05-16 00:50 +0200
SubjectRE: [PATCH] scsi: zero per-cmd driver data for each MQ I/O
Message-ID<tHwYp-5HR-1@gated-at.bofh.it>
> -----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

[toc] | [next] | [standalone]


#1642124

FromKY Srinivasan <kys@microsoft.com>
Date2017-05-16 01:30 +0200
Message-ID<tHxB8-6e6-17@gated-at.bofh.it>
In reply to#1642110

> -----Original Message-----
> From: Long Li
> Sent: Monday, May 15, 2017 3:48 PM
> 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-
> 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
> 
> > -----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?
Reviewed-by:  K. Y. Srinivasan <kys@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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web