CVE-2023-53252

Source
https://nvd.nist.gov/vuln/detail/CVE-2023-53252
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2023-53252.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2023-53252
Downstream
Related
Published
2025-09-15T14:46:21Z
Modified
2025-10-16T16:06:52.032698Z
Summary
Bluetooth: use RCU for hci_conn_params and iterate safely in hci_sync
Details

In the Linux kernel, the following vulnerability has been resolved:

Bluetooth: use RCU for hciconnparams and iterate safely in hci_sync

hciupdateacceptlistsync iterates over hdev->pendleconns and hdev->pendlereports, and waits for controller events in the loop body, without holding hdev lock.

Meanwhile, these lists and the items may be modified e.g. by lescancleanup. This can invalidate the list cursor or any other item in the list, resulting to invalid behavior (eg use-after-free).

Use RCU for the hciconnparams action lists. Since the loop bodies in hcisync block and we cannot use RCU or hdev->lock for the whole loop, copy list items first and then iterate on the copy. Only the flags field is written from elsewhere, so READONCE/WRITE_ONCE should guarantee we read valid values.

Free params everywhere with hciconnparams_free so the cleanup is guaranteed to be done properly.

This fixes the following, which can be triggered e.g. by BlueZ new mgmt-tester case "Add + Remove Device Nowait - Success", or by changing hcilesetcigparams to always return false, and running iso-tester:

================================================================== BUG: KASAN: slab-use-after-free in hciupdatepassivescansync (net/bluetooth/hcisync.c:2536 net/bluetooth/hcisync.c:2723 net/bluetooth/hci_sync.c:2841) Read of size 8 at addr ffff888001265018 by task kworker/u3:0/32

Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-1.fc38 04/01/2014 Workqueue: hci0 hcicmdsyncwork Call Trace: <TASK> dumpstacklvl (./arch/x86/include/asm/irqflags.h:134 lib/dumpstack.c:107) printreport (mm/kasan/report.c:320 mm/kasan/report.c:430) ? _virtaddrvalid (./include/linux/mmzone.h:1915 ./include/linux/mmzone.h:2011 arch/x86/mm/physaddr.c:65) ? hciupdatepassivescansync (net/bluetooth/hcisync.c:2536 net/bluetooth/hcisync.c:2723 net/bluetooth/hcisync.c:2841) kasanreport (mm/kasan/report.c:538) ? hciupdatepassivescansync (net/bluetooth/hcisync.c:2536 net/bluetooth/hcisync.c:2723 net/bluetooth/hcisync.c:2841) hciupdatepassivescansync (net/bluetooth/hcisync.c:2536 net/bluetooth/hcisync.c:2723 net/bluetooth/hcisync.c:2841) ? _pfxhciupdatepassivescansync (net/bluetooth/hcisync.c:2780) ? mutexlock (kernel/locking/mutex.c:282) ? _pfxmutexlock (kernel/locking/mutex.c:282) ? _pfxmutexunlock (kernel/locking/mutex.c:538) ? _pfxupdatepassivescansync (net/bluetooth/hcisync.c:2861) hcicmdsyncwork (net/bluetooth/hcisync.c:306) processonework (./arch/x86/include/asm/preempt.h:27 kernel/workqueue.c:2399) workerthread (./include/linux/list.h:292 kernel/workqueue.c:2538) ? _pfxworkerthread (kernel/workqueue.c:2480) kthread (kernel/kthread.c:376) ? _pfxkthread (kernel/kthread.c:331) retfromfork (arch/x86/entry/entry_64.S:314) </TASK>

Allocated by task 31: kasansavestack (mm/kasan/common.c:46) kasansettrack (mm/kasan/common.c:52) _kasankmalloc (mm/kasan/common.c:374 mm/kasan/common.c:383) hciconnparamsadd (./include/linux/slab.h:580 ./include/linux/slab.h:720 net/bluetooth/hcicore.c:2277) hciconnectlescan (net/bluetooth/hciconn.c:1419 net/bluetooth/hciconn.c:1589) hciconnectcis (net/bluetooth/hciconn.c:2266) isoconnectcis (net/bluetooth/iso.c:390) isosockconnect (net/bluetooth/iso.c:899) _sysconnect (net/socket.c:2003 net/socket.c:2020) _x64sysconnect (net/socket.c:2027) dosyscall64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80) entrySYSCALL64afterhwframe (arch/x86/entry/entry64.S:120)

Freed by task 15: kasansavestack (mm/kasan/common.c:46) kasansettrack (mm/kasan/common.c:52) kasansavefreeinfo (mm/kasan/generic.c:523) _kasanslabfree (mm/kasan/common.c:238 mm/kasan/common.c:200 mm/kasan/common.c:244) _kmemcachefree (mm/slub.c:1807 mm/slub.c:3787 mm/slub.c:3800) hciconnparamsdel (net/bluetooth/hcicore.c:2323) lescancleanup (net/bluetooth/hciconn.c:202) processonework (./arch/x86/include/asm/preempt. ---truncated---

References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
e8907f76544ffe225ab95d70f7313267b1d0c76d
Fixed
13ad45ad14df992a6754a130a19abc8c142d54e2
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
e8907f76544ffe225ab95d70f7313267b1d0c76d
Fixed
cef88a0fd8e9c2e838162fbb742b3e713b811a7e
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
e8907f76544ffe225ab95d70f7313267b1d0c76d
Fixed
195ef75e19287b4bc413da3e3e3722b030ac881e

Affected versions

v5.*

v5.15
v5.15-rc4
v5.15-rc5
v5.15-rc6
v5.15-rc7
v5.16
v5.16-rc1
v5.16-rc2
v5.16-rc3
v5.16-rc4
v5.16-rc5
v5.16-rc6
v5.16-rc7
v5.16-rc8
v5.17
v5.17-rc1
v5.17-rc2
v5.17-rc3
v5.17-rc4
v5.17-rc5
v5.17-rc6
v5.17-rc7
v5.17-rc8
v5.18
v5.18-rc1
v5.18-rc2
v5.18-rc3
v5.18-rc4
v5.18-rc5
v5.18-rc6
v5.18-rc7
v5.19
v5.19-rc1
v5.19-rc2
v5.19-rc3
v5.19-rc4
v5.19-rc5
v5.19-rc6
v5.19-rc7
v5.19-rc8

v6.*

v6.0
v6.0-rc1
v6.0-rc2
v6.0-rc3
v6.0-rc4
v6.0-rc5
v6.0-rc6
v6.0-rc7
v6.1
v6.1-rc1
v6.1-rc2
v6.1-rc3
v6.1-rc4
v6.1-rc5
v6.1-rc6
v6.1-rc7
v6.1-rc8
v6.1.1
v6.1.10
v6.1.11
v6.1.12
v6.1.13
v6.1.14
v6.1.15
v6.1.16
v6.1.17
v6.1.18
v6.1.19
v6.1.2
v6.1.20
v6.1.21
v6.1.22
v6.1.23
v6.1.24
v6.1.25
v6.1.26
v6.1.27
v6.1.28
v6.1.29
v6.1.3
v6.1.30
v6.1.31
v6.1.32
v6.1.33
v6.1.34
v6.1.35
v6.1.36
v6.1.37
v6.1.38
v6.1.39
v6.1.4
v6.1.40
v6.1.41
v6.1.5
v6.1.6
v6.1.7
v6.1.8
v6.1.9
v6.2
v6.2-rc1
v6.2-rc2
v6.2-rc3
v6.2-rc4
v6.2-rc5
v6.2-rc6
v6.2-rc7
v6.2-rc8
v6.3
v6.3-rc1
v6.3-rc2
v6.3-rc3
v6.3-rc4
v6.3-rc5
v6.3-rc6
v6.3-rc7
v6.4
v6.4-rc1
v6.4-rc2
v6.4-rc3
v6.4-rc4
v6.4-rc5
v6.4-rc6
v6.4-rc7
v6.4.1
v6.4.2
v6.4.3
v6.4.4
v6.4.5
v6.4.6
v6.5-rc1

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
5.17.0
Fixed
6.1.42
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.4.7