Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1505160

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

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf()
Date 2016-10-20 20:10 +0200
Message-ID <supWV-2CC-9@gated-at.bofh.it> (permalink)
References <su02u-2rf-55@gated-at.bofh.it> <suhmF-5dC-11@gated-at.bofh.it> <suhmF-5dC-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Vitaly Kuznetsov <vkuznets@redhat.com>
Date: Thu, 20 Oct 2016 10:51:04 +0200

> Stephen Hemminger <sthemmin@microsoft.com> 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 syncronize
> with netvsc_init_buf() as that would require locking, if we read stale
> NULL value after it was already updated on a different CPU we're fine,
> we'll just return -EAGAIN.

The concern is if we race with netvsc_destroy_buf() and this pointer
becomes NULL after the test you are adding.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf() Vitaly Kuznetsov <vkuznets@redhat.com> - 2016-10-19 16:30 +0200
  Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf() Vitaly Kuznetsov <vkuznets@redhat.com> - 2016-10-20 11:00 +0200
    Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send()  and netvsc_init_buf() David Miller <davem@davemloft.net> - 2016-10-20 20:10 +0200
      Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf() Vitaly Kuznetsov <vkuznets@redhat.com> - 2016-10-21 13:20 +0200
        Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send()  and netvsc_init_buf() David Miller <davem@davemloft.net> - 2016-10-21 17:00 +0200
          Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and netvsc_init_buf() Vitaly Kuznetsov <vkuznets@redhat.com> - 2016-10-21 17:20 +0200
            Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send()  and netvsc_init_buf() David Miller <davem@davemloft.net> - 2016-10-21 17:30 +0200
  RE: [PATCH net-next] hv_netvsc: fix a race between netvsc_send() and  netvsc_init_buf() Stephen Hemminger <sthemmin@microsoft.com> - 2016-10-20 11:20 +0200
  Re: [PATCH net-next] hv_netvsc: fix a race between netvsc_send()  and netvsc_init_buf() David Miller <davem@davemloft.net> - 2016-10-21 17:30 +0200

csiph-web