kernel_samsung_a53x/net
Tetsuo Handa 70f21ff8b6 Bluetooth: hci_core: cancel all works upon hci_unregister_dev()
[ Upstream commit 0d151a103775dd9645c78c97f77d6e2a5298d913 ]

syzbot is reporting that calling hci_release_dev() from hci_error_reset()
due to hci_dev_put() from hci_error_reset() can cause deadlock at
destroy_workqueue(), for hci_error_reset() is called from
hdev->req_workqueue which destroy_workqueue() needs to flush.

We need to make sure that hdev->{rx_work,cmd_work,tx_work} which are
queued into hdev->workqueue and hdev->{power_on,error_reset} which are
queued into hdev->req_workqueue are no longer running by the moment

       destroy_workqueue(hdev->workqueue);
       destroy_workqueue(hdev->req_workqueue);

are called from hci_release_dev().

Call cancel_work_sync() on these work items from hci_unregister_dev()
as soon as hdev->list is removed from hci_dev_list.

Reported-by: syzbot <syzbot+da0a9c9721e36db712e8@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=da0a9c9721e36db712e8
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 14:19:50 +01:00
..
6lowpan
9p net/9p: fix uninit-value in p9_client_rpc() 2024-11-19 12:27:18 +01:00
802
8021q
appletalk
atm
ax25
batman-adv batman-adv: Don't accept TT entries for out-of-spec VIDs 2024-11-19 14:19:34 +01:00
bluetooth Bluetooth: hci_core: cancel all works upon hci_unregister_dev() 2024-11-19 14:19:50 +01:00
bpf
bpfilter
bridge
caif
can net: can: j1939: enhanced error handling for tightly received RTS messages in xtp_rx_rts_session_new 2024-11-19 14:19:34 +01:00
ceph libceph: fix race between delayed_work() and ceph_monc_stop() 2024-11-19 14:19:45 +01:00
core bpf, sockmap: Fix sk->sk_forward_alloc warn_on in sk_stream_kill_queues 2024-11-19 14:19:42 +01:00
dcb
dccp
decnet
dns_resolver
dsa
ethernet
ethtool ethtool: netlink: do not return SQI value if link is down 2024-11-19 14:19:43 +01:00
hsr
ieee802154
ife
ipv4 tcp: avoid too many retransmit packets 2024-11-19 14:19:44 +01:00
ipv6 ila: block BH in ila_output() 2024-11-19 14:19:47 +01:00
iucv net/iucv: Avoid explicit cpumask var allocation on stack 2024-11-19 14:19:32 +01:00
kcm
key
l2tp
l3mdev
lapb
llc
mac80211 wifi: mac80211: fix UBSAN noise in ieee80211_prep_hw_scan() 2024-11-19 14:19:47 +01:00
mac802154 net: mac802154: Fix racy device stats updates by DEV_STATS_INC() and DEV_STATS_ADD() 2024-11-19 14:19:50 +01:00
mpls
mptcp mptcp: pm: update add_addr counters after connect 2024-11-19 14:19:05 +01:00
ncm
ncsi net/ncsi: Fix the multi thread manner of NCSI driver 2024-11-19 14:19:00 +01:00
netfilter netfilter: nf_tables: fully validate NFT_DATA_VALUE on store to data registers 2024-11-19 14:19:32 +01:00
netlabel
netlink netlink: annotate lockless accesses to nlk->max_recvmsg_len 2024-11-19 12:26:38 +01:00
netrom netrom: Fix a memory leak in nr_heartbeat_expiry() 2024-11-19 14:19:08 +01:00
nfc nfc: nci: Fix handling of zero-length payload packets in nci_rx_work() 2024-11-19 12:27:10 +01:00
nsh
openvswitch openvswitch: Set the skbuff pkt_type for proper pmtud support. 2024-11-19 12:27:09 +01:00
packet af_packet: avoid a false positive warning in packet_setsockopt() 2024-11-19 14:19:06 +01:00
phonet
psample
qrtr
rds
rfkill
rose
rxrpc
sched net/sched: Fix UAF when resolving a clash 2024-11-19 14:19:44 +01:00
sctp sctp: prefer struct_size over open coded arithmetic 2024-11-19 14:19:40 +01:00
skb_tracer
smc
strparser
sunrpc SUNRPC: Fix a NULL pointer deref in trace_svc_stats_latency() 2024-11-19 14:19:31 +01:00
switchdev
tipc tipc: force a dst refcount before doing decryption 2024-11-19 14:19:08 +01:00
tls tls: fix missing memory barrier in tls_init 2024-11-19 12:27:09 +01:00
unix af_unix: Annotate data-race of sk->sk_shutdown in sk_diag_fill(). 2024-11-19 14:19:01 +01:00
vmw_vsock
wimax
wireless wifi: cfg80211: wext: add extra SIOCSIWSCAN data check 2024-11-19 14:19:47 +01:00
x25
xdp
xfrm net: fix __dst_negative_advice() race 2024-11-19 12:27:19 +01:00
compat.c
devres.c
Kconfig
Makefile
socket.c
sysctl_net.c
TEST_MAPPING