From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aserp2120.oracle.com ([141.146.126.78]:58982 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727022AbeK2NjP (ORCPT ); Thu, 29 Nov 2018 08:39:15 -0500 To: kys@linuxonhyperv.com Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@linuxdriverproject.org, ohering@suse.com, James.Bottomley@HansenPartnership.com, hch@infradead.org, linux-scsi@vger.kernel.org, apw@canonical.com, vkuznets@redhat.com, jasowang@redhat.com, martin.petersen@oracle.com, hare@suse.de, kys@microsoft.com, Dexuan Cui , stable@vger.kernel.org, Long Li , Stephen Hemminger , Haiyang Zhang Subject: Re: [PATCH] scsi: storvsc: Fix a race in sub-channel creation that can cause panic From: "Martin K. Petersen" References: <20181126002617.7398-1-kys@linuxonhyperv.com> Date: Wed, 28 Nov 2018 21:34:03 -0500 In-Reply-To: <20181126002617.7398-1-kys@linuxonhyperv.com> (kys@linuxonhyperv.com's message of "Mon, 26 Nov 2018 00:26:17 +0000") Message-ID: MIME-Version: 1.0 Content-Type: text/plain Sender: stable-owner@vger.kernel.org List-ID: 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