Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-21 Thread David Miller
From: Vitaly Kuznetsov Date: Fri, 21 Oct 2016 17:17:18 +0200 > David Miller writes: > >> From: Vitaly Kuznetsov >> Date: Fri, 21 Oct 2016 13:15:53 +0200 >> >>> David Miller writes: >>> From: Vitaly

Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-21 Thread David Miller
From: Vitaly Kuznetsov Date: Fri, 21 Oct 2016 17:17:18 +0200 > David Miller writes: > >> From: Vitaly Kuznetsov >> Date: Fri, 21 Oct 2016 13:15:53 +0200 >> >>> David Miller writes: >>> From: Vitaly Kuznetsov Date: Thu, 20 Oct 2016 10:51:04 +0200 > Stephen Hemminger

Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-21 Thread David Miller
From: Vitaly Kuznetsov Date: Wed, 19 Oct 2016 15:53:01 +0200 > Fix in commit 880988348270 ("hv_netvsc: set nvdev link after populating > chn_table") turns out to be incomplete. A crash in > netvsc_get_next_send_section() is observed on mtu change when the device > is under

Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-21 Thread David Miller
From: Vitaly Kuznetsov Date: Wed, 19 Oct 2016 15:53:01 +0200 > Fix in commit 880988348270 ("hv_netvsc: set nvdev link after populating > chn_table") turns out to be incomplete. A crash in > netvsc_get_next_send_section() is observed on mtu change when the device > is under load. The race I

Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-21 Thread Vitaly Kuznetsov
David Miller writes: > From: Vitaly Kuznetsov > Date: Fri, 21 Oct 2016 13:15:53 +0200 > >> David Miller writes: >> >>> From: Vitaly Kuznetsov >>> Date: Thu, 20 Oct 2016 10:51:04 +0200 >>> Stephen

Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-21 Thread Vitaly Kuznetsov
David Miller writes: > From: Vitaly Kuznetsov > Date: Fri, 21 Oct 2016 13:15:53 +0200 > >> David Miller writes: >> >>> From: Vitaly Kuznetsov >>> Date: Thu, 20 Oct 2016 10:51:04 +0200 >>> Stephen Hemminger writes: > Do we need ACCESS_ONCE() here to avoid check/use issues?

Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-21 Thread David Miller
From: Vitaly Kuznetsov Date: Fri, 21 Oct 2016 13:15:53 +0200 > David Miller writes: > >> From: Vitaly Kuznetsov >> Date: Thu, 20 Oct 2016 10:51:04 +0200 >> >>> Stephen Hemminger writes: >>> Do we

Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-21 Thread David Miller
From: Vitaly Kuznetsov Date: Fri, 21 Oct 2016 13:15:53 +0200 > David Miller writes: > >> From: Vitaly Kuznetsov >> Date: Thu, 20 Oct 2016 10:51:04 +0200 >> >>> Stephen Hemminger writes: >>> Do we need ACCESS_ONCE() here to avoid check/use issues? >>> >>> I think we don't: this is

Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-21 Thread Vitaly Kuznetsov
David Miller writes: > From: Vitaly Kuznetsov > Date: Thu, 20 Oct 2016 10:51:04 +0200 > >> Stephen Hemminger writes: >> >>> Do we need ACCESS_ONCE() here to avoid check/use issues? >>> >> >> I think we don't: this is the only

Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-21 Thread Vitaly Kuznetsov
David Miller writes: > From: Vitaly Kuznetsov > Date: Thu, 20 Oct 2016 10:51:04 +0200 > >> Stephen Hemminger writes: >> >>> Do we need ACCESS_ONCE() here to avoid check/use issues? >>> >> >> I think we don't: this is the only place in the function where we read >> the variable so we'll get

Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-20 Thread David Miller
From: Vitaly Kuznetsov Date: Thu, 20 Oct 2016 10:51:04 +0200 > Stephen Hemminger writes: > >> Do we need ACCESS_ONCE() here to avoid check/use issues? >> > > I think we don't: this is the only place in the function where we read > the variable so

Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-20 Thread David Miller
From: Vitaly Kuznetsov Date: Thu, 20 Oct 2016 10:51:04 +0200 > Stephen Hemminger writes: > >> Do we need ACCESS_ONCE() here to avoid check/use issues? >> > > I think we don't: this is the only place in the function where we read > the variable so we'll get normal read. We're not trying to

RE: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-20 Thread Stephen Hemminger
kernel@vger.kernel.org; KY Srinivasan <k...@microsoft.com>; Haiyang Zhang <haiya...@microsoft.com> Subject: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf() Fix in commit 880988348270 ("hv_netvsc: set nvdev link after populating chn_table"

RE: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-20 Thread Stephen Hemminger
Srinivasan ; Haiyang Zhang Subject: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf() Fix in commit 880988348270 ("hv_netvsc: set nvdev link after populating chn_table") turns out to be incomplete. A crash in netvsc_get_next_send_section() is observed on

Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-20 Thread Vitaly Kuznetsov
kernel.org > Cc: Stephen Hemminger <sthem...@microsoft.com>; de...@linuxdriverproject.org; > linux-kernel@vger.kernel.org; KY Srinivasan <k...@microsoft.com>; Haiyang > Zhang <haiya...@microsoft.com> > Subject: [PATCH net-next] hv_netvsc: fix a race between ne

Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-20 Thread Vitaly Kuznetsov
tephen Hemminger ; de...@linuxdriverproject.org; > linux-kernel@vger.kernel.org; KY Srinivasan ; Haiyang > Zhang > Subject: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and > netvsc_init_buf() > > Fix in commit 880988348270 ("hv_netvsc: set nvdev link after populat

[PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-19 Thread Vitaly Kuznetsov
Fix in commit 880988348270 ("hv_netvsc: set nvdev link after populating chn_table") turns out to be incomplete. A crash in netvsc_get_next_send_section() is observed on mtu change when the device is under load. The race I identified is: if we get to netvsc_send() after we set net_device_ctx->nvdev

[PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()

2016-10-19 Thread Vitaly Kuznetsov
Fix in commit 880988348270 ("hv_netvsc: set nvdev link after populating chn_table") turns out to be incomplete. A crash in netvsc_get_next_send_section() is observed on mtu change when the device is under load. The race I identified is: if we get to netvsc_send() after we set net_device_ctx->nvdev