android_kernel_motorola_sm6375/net
Repository files (latest commit first)
Filename Latest commit message Latest commit date
ZhengHan Wang 3c4236f1b2 Bluetooth: Fix double free in hci_conn_cleanup
[ Upstream commit a85fb91e3d728bdfc80833167e8162cce8bc7004 ]

syzbot reports a slab use-after-free in hci_conn_hash_flush [1].
After releasing an object using hci_conn_del_sysfs in the
hci_conn_cleanup function, releasing the same object again
using the hci_dev_put and hci_conn_put functions causes a double free.
Here's a simplified flow:

hci_conn_del_sysfs:
  hci_dev_put
    put_device
      kobject_put
        kref_put
          kobject_release
            kobject_cleanup
              kfree_const
                kfree(name)

hci_dev_put:
  ...
    kfree(name)

hci_conn_put:
  put_device
    ...
      kfree(name)

This patch drop the hci_dev_put and hci_conn_put function
call in hci_conn_cleanup function, because the object is
freed in hci_conn_del_sysfs function.

This patch also fixes the refcounting in hci_conn_add_sysfs() and
hci_conn_del_sysfs() to take into account device_add() failures.

This fixes CVE-2023-28464.

Link: https://syzkaller.appspot.com/bug?id=1bb51491ca5df96a5f724899d1dbb87afda61419 [1]

Signed-off-by: ZhengHan Wang <wzhmmmmm@gmail.com>
Co-developed-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-11-28 16:50:14 +00:00
..
6lowpan
9p 9p: virtio: make sure 'offs' is initialized in zc_request 2023-09-23 10:59:37 +02:00
802
8021q
appletalk
atm
ax25
batman-adv batman-adv: Hold rtnl lock during MTU update via netlink 2023-08-30 16:27:25 +02:00
bluetooth Bluetooth: Fix double free in hci_conn_cleanup 2023-11-28 16:50:14 +00:00
bpf
bpfilter
bridge net: bridge: use DEV_STATS_INC() 2023-10-10 21:46:37 +02:00
caif
can
ceph libceph: use kernel_connect() 2023-10-25 11:53:19 +02:00
core net: annotate data-races around sk->sk_dst_pending_confirm 2023-11-28 16:50:14 +00:00
dcb
dccp dccp/tcp: Call security_inet_conn_request() after setting IPv6 addresses. 2023-11-20 10:30:15 +01:00
decnet
dns_resolver
dsa
ethernet
hsr
ieee802154
ife
ipv4 net: annotate data-races around sk->sk_dst_pending_confirm 2023-11-28 16:50:14 +00:00
ipv6 dccp/tcp: Call security_inet_conn_request() after setting IPv6 addresses. 2023-11-20 10:30:15 +01:00
iucv
kcm kcm: Fix error handling for SOCK_DGRAM in kcm_sendmsg(). 2023-09-23 11:00:02 +02:00
key net: af_key: fix sadb_x_filter validation 2023-08-30 16:27:16 +02:00
l2tp ipv4, ipv6: Fix handling of transhdrlen in __ip{,6}_append_data() 2023-10-10 21:46:44 +02:00
l3mdev
lapb
llc llc: verify mac len before reading mac header 2023-11-20 10:30:15 +01:00
mac80211 wifi: mac80211: don't return unset power in ieee80211_get_tx_power() 2023-11-28 16:50:13 +00:00
mac802154
mpls
ncsi ncsi: Propagate carrier gain/loss events to the NCSI controller 2023-10-10 21:46:40 +02:00
netfilter netfilter: nat: fix ipv6 nat redirect with mapped and scoped addresses 2023-11-20 10:30:16 +01:00
netlabel netlabel: fix shift wrapping bug in netlbl_catmap_setlong() 2023-09-23 10:59:39 +02:00
netlink
netrom netrom: Deny concurrent connect(). 2023-09-23 10:59:43 +02:00
nfc nfc: nci: fix possible NULL pointer dereference in send_acknowledge() 2023-10-25 11:53:20 +02:00
nsh
openvswitch
packet net/packet: annotate data-races around tp->status 2023-08-16 18:19:23 +02:00
phonet
psample
qrtr
rds net: prevent address rewrite in kernel_bind() 2023-10-25 11:53:18 +02:00
rfkill net: rfkill: gpio: prevent value glitch during probe 2023-10-25 11:53:21 +02:00
rose
rxrpc
sched net/sched: sch_hfsc: upgrade 'rt' to 'sc' when it becomes a inner curve 2023-10-25 11:53:21 +02:00
sctp sctp: update hb timer immediately after users change hb_interval 2023-10-10 21:46:45 +02:00
smc net/smc: fix dangling sock under state SMC_APPFINCLOSEWAIT 2023-11-20 10:30:16 +01:00
strparser
sunrpc SUNRPC: Mark the cred for revalidation if the server rejects it 2023-10-10 21:46:35 +02:00
switchdev
tipc tipc: Change nla_policy for bearer-related names to NLA_NUL_STRING 2023-11-20 10:30:15 +01:00
tls net/tls: do not free tls_rec on async operation in bpf_exec_tx_verdict() 2023-09-23 11:00:02 +02:00
unix af_unix: Fix data-race around unix_tot_inflight. 2023-09-23 10:59:58 +02:00
vmw_vsock
wimax
wireless wifi: cfg80211: avoid leaking stack data into trace 2023-10-25 11:53:23 +02:00
x25
xdp
xfrm xfrm: interface: use DEV_STATS_INC() 2023-10-25 11:53:21 +02:00
compat.c
Kconfig
Makefile
socket.c net: prevent address rewrite in kernel_bind() 2023-10-25 11:53:18 +02:00
sysctl_net.c