From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Martin K. Petersen" Subject: Re: [PATCH] scsi: storvsc: Fix a race in sub-channel creation that can cause panic Date: Wed, 28 Nov 2018 21:34:03 -0500 Message-ID: References: <20181126002617.7398-1-kys@linuxonhyperv.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20181126002617.7398-1-kys@linuxonhyperv.com> (kys@linuxonhyperv.com's message of "Mon, 26 Nov 2018 00:26:17 +0000") List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: kys@linuxonhyperv.com Cc: hch@infradead.org, Stephen Hemminger , martin.petersen@oracle.com, linux-scsi@vger.kernel.org, gregkh@linuxfoundation.org, jasowang@redhat.com, ohering@suse.com, stable@vger.kernel.org, linux-kernel@vger.kernel.org, James.Bottomley@HansenPartnership.com, Haiyang Zhang , hare@suse.de, apw@canonical.com, devel@linuxdriverproject.org, vkuznets@redhat.com List-Id: linux-scsi@vger.kernel.org KY, > From: Dexuan Cui > > We can concurrently try to open the same sub-channel from 2 paths: > > path #1: vmbus_onoffer() -> vmbus_process_offer() -> handle_sc_creation(). > path #2: storvsc_probe() -> storvsc_connect_to_vsp() -> > -> storvsc_channel_init() -> handle_multichannel_storage() -> > -> vmbus_are_subchannels_present() -> handle_sc_creation(). > > They conflict with each other, but it was not an issue before the recent > commit ae6935ed7d42 ("vmbus: split ring buffer allocation from open"), > because at the beginning of vmbus_open() we checked newchannel->state so > only one path could succeed, and the other would return with -EINVAL. Applied to 4.20/scsi-fixes. Thank you! -- Martin K. Petersen Oracle Linux Engineering