From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933501AbdESBq0 (ORCPT ); Thu, 18 May 2017 21:46:26 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:47777 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755450AbdESBqV (ORCPT ); Thu, 18 May 2017 21:46:21 -0400 To: Long Li Cc: "James E.J. Bottomley" , "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, KY Srinivasan , Bart Van Assche , Christoph Hellwig , Stephen Hemminger , Long Li , stable@vger.kernel.org Subject: Re: [PATCH v2] scsi: zero per-cmd private driver data for each MQ I/O From: "Martin K. Petersen" Organization: Oracle Corporation References: <1495147205-28778-1-git-send-email-longli@exchange.microsoft.com> Date: Thu, 18 May 2017 21:45:24 -0400 In-Reply-To: <1495147205-28778-1-git-send-email-longli@exchange.microsoft.com> (Long Li's message of "Thu, 18 May 2017 15:40:05 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Source-IP: aserv0022.oracle.com [141.146.126.234] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Long, > In lower layer driver's (LLD) scsi_host_template, the driver may > optionally ask SCSI to allocate its private driver memory for each > command, by specifying cmd_size. This memory is allocated at the end > of scsi_cmnd by SCSI. Later when SCSI queues a command, the LLD can > use scsi_cmd_priv to get to its private data. > > Some LLD, e.g. hv_storvsc, doesn't clear its private data before > use. In this case, the LLD may get to stale or uninitialized data in > its private driver memory. This may result in unexpected driver and > hardware behavior. > > Fix this problem by also zeroing the private driver memory before > passing them to LLD. Applied to 4.12/scsi-fixes. Thank you! -- Martin K. Petersen Oracle Linux Engineering