linux/drivers/net
Anssi Hannula 33ddee2b95 can: kvaser_usb: Fix possible completions during init_completion
commit 2871edb32f upstream.

kvaser_usb uses completions to signal when a response event is received
for outgoing commands.

However, it uses init_completion() to reinitialize the start_comp and
stop_comp completions before sending the start/stop commands.

In case the device sends the corresponding response just before the
actual command is sent, complete() may be called concurrently with
init_completion() which is not safe.

This might be triggerable even with a properly functioning device by
stopping the interface (CMD_STOP_CHIP) just after it goes bus-off (which
also causes the driver to send CMD_STOP_CHIP when restart-ms is off),
but that was not tested.

Fix the issue by using reinit_completion() instead.

Fixes: 080f40a6fa ("can: kvaser_usb: Add support for Kvaser CAN/USB devices")
Tested-by: Jimmy Assarsson <extja@kvaser.com>
Signed-off-by: Anssi Hannula <anssi.hannula@bitwise.fi>
Signed-off-by: Jimmy Assarsson <extja@kvaser.com>
Link: https://lore.kernel.org/all/20221010185237.319219-2-extja@kvaser.com
Cc: stable@vger.kernel.org
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-11-03 23:59:10 +09:00
..
appletalk
arcnet
bonding bonding: fix NULL deref in bond_rr_gen_slave_id 2022-09-28 11:11:53 +02:00
caif caif_virtio: fix race between virtio_device_ready() and ndo_open() 2022-07-07 17:53:27 +02:00
can can: kvaser_usb: Fix possible completions during init_completion 2022-11-03 23:59:10 +09:00
dsa net: mt7531: only do PLL once after the reset 2022-10-05 10:39:38 +02:00
ethernet net: hns: fix possible memory leak in hnae_ae_register() 2022-10-29 10:12:57 +02:00
fddi
fjes
hamradio hamradio: remove needs_free_netdev to avoid UAF 2022-04-20 09:34:04 +02:00
hippi drivers: net: hippi: Fix deadlock in rr_close() 2022-05-09 09:14:40 +02:00
hyperv hv_netvsc: Fix race between VF offering and VF association message from host 2022-10-26 12:34:18 +02:00
ieee802154 ieee802154: cc2520: add rc code in cc2520_tx() 2022-09-20 12:39:44 +02:00
ipa net: ipa: properly limit modem routing table use 2022-09-28 11:11:50 +02:00
ipvlan ipvlan: Fix out-of-bound bugs caused by unset skb->mac_header 2022-09-28 11:11:47 +02:00
mctp
mdio of: mdio: Add of_node_put() when breaking out of for_each_xx 2022-09-28 11:11:50 +02:00
netdevsim net: Use u64_stats_fetch_begin_irq() for stats fetch. 2022-09-08 12:28:07 +02:00
pcs net: pcs: xpcs: propagate xpcs_read error to xpcs_get_state_c37_sgmii 2022-08-03 12:03:48 +02:00
phy net: phy: dp83822: disable MDI crossover status change interrupt 2022-10-29 10:12:57 +02:00
plip plip: avoid rcu debug splat 2022-08-25 11:40:11 +02:00
ppp net: fix dev_fill_forward_path with pppoe + bridge 2022-05-25 09:57:31 +02:00
slip drivers: net: slip: fix NPD bug in sl_tx_timeout() 2022-04-20 09:34:17 +02:00
team net: team: Unsync device addresses on ndo_stop 2022-09-28 11:11:48 +02:00
usb r8152: add PID for the Lenovo OneLink+ Dock 2022-10-29 10:12:53 +02:00
vmxnet3 net: vmxnet3: fix possible NULL pointer dereference in vmxnet3_rq_cleanup() 2022-05-25 09:57:31 +02:00
wan
wireguard wireguard: netlink: avoid variable-sized memcpy on sockaddr 2022-09-28 11:11:51 +02:00
wireless wifi: rt2x00: correctly set BBP register 86 for MT7620 2022-10-26 12:35:37 +02:00
wwan wwan_hwsim: fix possible memory leak in wwan_hwsim_dev_new() 2022-10-29 10:12:57 +02:00
xen-netback xen-netback: only remove 'hotplug-status' when the vif is actually destroyed 2022-09-15 11:30:05 +02:00
bareudp.c bareudp: use ipv6_mod_enabled to check if IPv6 enabled 2022-04-08 14:23:41 +02:00
dummy.c
eql.c
geneve.c geneve: fix TOS inheriting for ipv4 2022-08-25 11:40:15 +02:00
gtp.c
ifb.c
Kconfig lib/crypto: blake2s: include as built-in 2022-05-30 09:28:59 +02:00
LICENSE.SRC
loopback.c
macsec.c Revert "net: macsec: update SCI upon MAC address change." 2022-08-31 17:16:37 +02:00
macvlan.c net: use eth_hw_addr_set() instead of ether_addr_copy() 2022-08-31 17:16:37 +02:00
macvtap.c macvtap: advertise link netns via netlink 2022-04-13 20:59:07 +02:00
Makefile
mdio.c
mhi_net.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
Space.c
sungem_phy.c net: sungem_phy: Add of_node_put() for reference returned by of_get_parent() 2022-08-03 12:03:48 +02:00
tap.c tuntap: add sanity checks about msg_controllen in sendmsg 2022-04-13 20:59:07 +02:00
thunderbolt.c net: thunderbolt: Enable DMA paths only after rings are enabled 2022-10-26 12:34:21 +02:00
tun.c net: tun: split run_ebpf_filter() and pskb_trim() into different "if statement" 2022-07-29 17:25:11 +02:00
veth.c veth: Ensure eth header is in skb's linear part 2022-04-20 09:34:10 +02:00
virtio_net.c virtio_net: fix memory leak inside XPD_TX with mergeable 2022-08-25 11:40:06 +02:00
vrf.c vrf: fix packet sniffing for traffic originating from ip tunnels 2022-04-13 20:59:15 +02:00
vsockmon.c
vxlan.c vxlan: fix error return code in vxlan_fdb_append 2022-04-27 14:38:55 +02:00
xen-netfront.c xen-netfront: restore __skb_queue_tail() positioning in xennet_get_responses() 2022-07-07 17:53:32 +02:00