All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Dexuan Cui <decui@microsoft.com>
Cc: "gregkh\@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"driverdev-devel\@linuxdriverproject.org" 
	<driverdev-devel@linuxdriverproject.org>,
	"olaf\@aepfle.de" <olaf@aepfle.de>,
	"apw\@canonical.com" <apw@canonical.com>,
	"jasowang\@redhat.com" <jasowang@redhat.com>,
	KY Srinivasan <kys@microsoft.com>,
	Haiyang Zhang <haiyangz@microsoft.com>,
	"rolf.neugebauer\@docker.com" <rolf.neugebauer@docker.com>,
	"dave.scott\@docker.com" <dave.scott@docker.com>,
	"ian.campbell\@docker.com" <ian.campbell@docker.com>
Subject: Re: [PATCH v3] Drivers: hv: vmbus: fix the race when querying & updating the percpu list
Date: Wed, 01 Jun 2016 10:58:56 +0200	[thread overview]
Message-ID: <87h9ddffov.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <BLUPR03MB14100FD9210DDABD4C57A321BF470@BLUPR03MB1410.namprd03.prod.outlook.com> (Dexuan Cui's message of "Wed, 1 Jun 2016 06:39:54 +0000")

Dexuan Cui <decui@microsoft.com> writes:

>> From: Vitaly Kuznetsov [mailto:vkuznets@redhat.com]
>> Sent: Wednesday, June 1, 2016 0:27
>> To: Dexuan Cui <decui@microsoft.com>
>> Cc: gregkh@linuxfoundation.org; linux-kernel@vger.kernel.org; driverdev-
>> devel@linuxdriverproject.org; olaf@aepfle.de; apw@canonical.com;
>> jasowang@redhat.com; KY Srinivasan <kys@microsoft.com>; Haiyang
>> Zhang <haiyangz@microsoft.com>; rolf.neugebauer@docker.com;
>> dave.scott@docker.com; ian.campbell@docker.com
>> Subject: Re: [PATCH v3] Drivers: hv: vmbus: fix the race when querying &
>> updating the percpu list
>> 
>> Dexuan Cui <decui@microsoft.com> writes:
>> 
>> > There is a rare race when we remove an entry from the global list
>> > hv_context.percpu_list[cpu] in hv_process_channel_removal() ->
>> > percpu_channel_deq() -> list_del(): at this time, if vmbus_on_event() ->
>> > process_chn_event() -> pcpu_relid2channel() is trying to query the list,
>> > we can get the kernel fault.
>> >
>> > Similarly, we also have the issue in the code path: vmbus_process_offer()
>> ->
>> > percpu_channel_enq().
>> >
>> > We can resolve the issue by disabling the tasklet when updating the list.
>> >
>> > The patch also moves vmbus_release_relid() to a later place where
>> > the channel has been removed from the per-cpu and the global lists.
>> >
>> > Reported-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
>> > Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
>> > Signed-off-by: Dexuan Cui <decui@microsoft.com>
>> 
>> Tested 4.7-rc1 with this path applied and kernel always crashes on boot
>> (WS2016TP5, 12 CPU SMP guest, Generation 2):
>> 
>> [    5.464251] hv_vmbus: Hyper-V Host Build:14300-10.0-1-0.1006; Vmbus
>> version:4.0
>> [    5.471666] hv_vmbus: Unknown GUID: f8e65716-3cb3-4a06-9a60-
>> 1889c5cccab5
>> [    5.472143] BUG: unable to handle kernel paging request at
>> 000000079fff5288
>> [    5.477107] IP: [<ffffffffa0004b91>] vmbus_onoffer+0x311/0x570
>> [hv_vmbus]
>> ...
>>   Vitaly
>
> I can't reproduce the panic somehow, but I did find a bug in vmbus_process_offer():
>
> "hv_event_tasklet_disable(channel) and hv_event_tasklet_enable(channel)"
> are buggy: the 'channel' parameter should be 'newchannel'.
>
> This was a copy-and-paste bug... Sorry!
> Can you fix this and see if the panic will disappear in your side?

This fixes the issue I'm seeing, thanks!

-- 
  Vitaly

  reply	other threads:[~2016-06-01  8:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-22  6:02 [PATCH v3] Drivers: hv: vmbus: fix the race when querying & updating the percpu list Dexuan Cui
2016-05-31 16:26 ` Vitaly Kuznetsov
2016-06-01  6:39   ` Dexuan Cui
2016-06-01  8:58     ` Vitaly Kuznetsov [this message]
2016-06-01 10:01       ` Dexuan Cui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h9ddffov.fsf@vitty.brq.redhat.com \
    --to=vkuznets@redhat.com \
    --cc=apw@canonical.com \
    --cc=dave.scott@docker.com \
    --cc=decui@microsoft.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=haiyangz@microsoft.com \
    --cc=ian.campbell@docker.com \
    --cc=jasowang@redhat.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olaf@aepfle.de \
    --cc=rolf.neugebauer@docker.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.