]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
hv_netvsc: set nvdev link after populating chn_table
authorVitaly Kuznetsov <vkuznets@redhat.com>
Fri, 13 May 2016 11:55:25 +0000 (13:55 +0200)
committerTim Gardner <tim.gardner@canonical.com>
Fri, 16 Sep 2016 17:08:45 +0000 (11:08 -0600)
commitcb34dd7924b4b359200f7c06f96df95213468e47
tree8e35e9a74ec1dd3f1364b3e09d90b3b334ca3319
parent30b4420d85537410ce7c5106a6ea066306e7ea68
hv_netvsc: set nvdev link after populating chn_table

BugLink: http://bugs.launchpad.net/bugs/1616677
Crash in netvsc_send() is observed when netvsc device is re-created on
mtu change/set channels. The crash is caused by dereferencing of NULL
channel pointer which comes from chn_table. The root cause is a mixture
of two facts:
- we set nvdev pointer in net_device_context in alloc_net_device()
  before we populate chn_table.
- we populate chn_table[0] only.

The issue could be papered over by checking channel != NULL in
netvsc_send() but populating the whole chn_table and writing the
nvdev pointer afterwards seems more appropriate.

Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 88098834827025cc04c15f1b4b0d9bbef3cf55af)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Kamal Mostafa <kamal@canonical.com>
drivers/net/hyperv/netvsc.c