linux-uconsole/drivers/net
Stefan Assmann db5b2fe4d3 i40e: check __I40E_VF_DISABLE bit in i40e_sync_filters_subtask
commit a7542b8760 upstream.

While testing VF spawn/destroy the following panic occurred.

BUG: unable to handle kernel NULL pointer dereference at 0000000000000029
[...]
Workqueue: i40e i40e_service_task [i40e]
RIP: 0010:i40e_sync_vsi_filters+0x6fd/0xc60 [i40e]
[...]
Call Trace:
 ? __switch_to_asm+0x35/0x70
 ? __switch_to_asm+0x41/0x70
 ? __switch_to_asm+0x35/0x70
 ? _cond_resched+0x15/0x30
 i40e_sync_filters_subtask+0x56/0x70 [i40e]
 i40e_service_task+0x382/0x11b0 [i40e]
 ? __switch_to_asm+0x41/0x70
 ? __switch_to_asm+0x41/0x70
 process_one_work+0x1a7/0x3b0
 worker_thread+0x30/0x390
 ? create_worker+0x1a0/0x1a0
 kthread+0x112/0x130
 ? kthread_bind+0x30/0x30
 ret_from_fork+0x35/0x40

Investigation revealed a race where pf->vf[vsi->vf_id].trusted may get
accessed by the watchdog via i40e_sync_filters_subtask() although
i40e_free_vfs() already free'd pf->vf.
To avoid this the call to i40e_sync_vsi_filters() in
i40e_sync_filters_subtask() needs to be guarded by __I40E_VF_DISABLE,
which is also used by i40e_free_vfs().

Note: put the __I40E_VF_DISABLE check after the
__I40E_MACVLAN_SYNC_PENDING check as the latter is more likely to
trigger.

CC: stable@vger.kernel.org
Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-05 13:10:08 +02:00
..
appletalk
arcnet arcnet: provide a buffer big enough to actually receive packets 2019-10-05 13:09:26 +02:00
bonding bonding: Force slave speed check after link state recovery for 802.3ad 2019-08-29 08:28:28 +02:00
caif caif-hsi: fix possible deadlock in cfhsi_exit_module() 2019-07-28 08:29:23 +02:00
can can: peak_usb: force the string buffer NULL-terminated 2019-08-29 08:28:38 +02:00
dsa net: dsa: mv88e6xxx: wait after reset deactivation 2019-07-28 08:29:24 +02:00
ethernet i40e: check __I40E_VF_DISABLE bit in i40e_sync_filters_subtask 2019-10-05 13:10:08 +02:00
fddi
fjes
hamradio net/hamradio/6pack: use mod_timer() to rearm timers 2019-01-09 17:38:32 +01:00
hippi
hyperv hv_netvsc: Fix a warning of suspicious RCU usage 2019-09-10 10:33:43 +01:00
ieee802154 ieee802154: hwsim: unregister hw while hwsim_subscribe_all_others fails 2019-09-21 07:16:47 +02:00
ipvlan net: ipvlan: Fix ipvlan device tso disabled while NETIF_F_IP_CSUM is set 2019-06-25 11:35:58 +08:00
netdevsim
phy net/phy: fix DP83865 10 Mbps HDX loopback disable function 2019-10-05 13:09:27 +02:00
plip
ppp ppp: Fix memory leak in ppp_write 2019-10-05 13:09:29 +02:00
slip slip: make slhc_free() silently accept an error pointer 2019-05-02 09:58:56 +02:00
team team: Add vlan tx offload to hw_enc_features 2019-08-25 10:48:04 +02:00
usb usbnet: sanity checking of packet sizes and device mtu 2019-10-05 13:09:30 +02:00
vmxnet3
wan net/wan: fix a double free in x25_asy_open_tty() 2019-01-09 17:38:32 +01:00
wimax wimax/i2400m: fix a memory leak bug 2019-09-10 10:33:48 +01:00
wireless iwlwifi: fw: don't send GEO_TX_POWER_LIMIT command to FW version 36 2019-10-05 13:09:59 +02:00
xen-netback xen/netback: Reset nr_frags before freeing skb 2019-08-25 10:48:05 +02:00
dummy.c
eql.c
geneve.c geneve: correctly handle ipv6.disable module parameter 2019-03-10 07:17:17 +01:00
gtp.c gtp: fix use-after-free in gtp_newlink() 2019-07-26 09:14:17 +02:00
ifb.c
Kconfig gtp: change NET_UDP_TUNNEL dependency to select 2019-04-03 06:26:15 +02:00
LICENSE.SRC
loopback.c
macsec.c macsec: drop skb sk before calling gro_cells_receive 2019-10-05 13:09:27 +02:00
macvlan.c macvlan: return correct error value 2018-12-21 14:15:20 +01:00
macvtap.c
Makefile net: Always descend into dsa/ 2019-05-25 18:23:19 +02:00
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c
tap.c
thunderbolt.c net: thunderbolt: Unregister ThunderboltIP protocol handler when suspending 2019-06-15 11:54:07 +02:00
tun.c tun: fix use-after-free when register netdev failed 2019-09-19 09:09:33 +02:00
veth.c
virtio_net.c virtio_net: Account for tx bytes and packets on sending xdp_frames 2019-02-12 19:47:23 +01:00
vrf.c vrf: make sure skb->data contains ip header to make routing 2019-07-28 08:29:26 +02:00
vsockmon.c
vxlan.c vxlan: Don't call gro_cells_destroy() before device is unregistered 2019-04-03 06:26:18 +02:00
xen-netfront.c xen-netfront: do not assume sk_buff_head list is empty in error handling 2019-09-21 07:16:43 +02:00