CVE-2024-53237

Source
https://cve.org/CVERecord?id=CVE-2024-53237
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-53237.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2024-53237
Downstream
Related
Published
2024-12-27T13:50:23.150Z
Modified
2026-03-20T12:40:50.296520Z
Severity
  • 7.8 (High) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
Bluetooth: fix use-after-free in device_for_each_child()
Details

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

Bluetooth: fix use-after-free in deviceforeach_child()

Syzbot has reported the following KASAN splat:

BUG: KASAN: slab-use-after-free in deviceforeach_child+0x18f/0x1a0 Read of size 8 at addr ffff88801f605308 by task kbnepd bnep0/4980

CPU: 0 UID: 0 PID: 4980 Comm: kbnepd bnep0 Not tainted 6.12.0-rc4-00161-gae90f6a6170d #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.3-2.fc40 04/01/2014 Call Trace: <TASK> dumpstacklvl+0x100/0x190 ? deviceforeachchild+0x18f/0x1a0 printreport+0x13a/0x4cb ? __virtaddrvalid+0x5e/0x590 ? __physaddr+0xc6/0x150 ? deviceforeachchild+0x18f/0x1a0 kasanreport+0xda/0x110 ? deviceforeachchild+0x18f/0x1a0 ? __pfxdevmemallocnoio+0x10/0x10 deviceforeachchild+0x18f/0x1a0 ? __pfxdeviceforeachchild+0x10/0x10 pmruntimesetmemallocnoio+0xf2/0x180 netdevunregisterkobject+0x1ed/0x270 unregisternetdevicemany_notify+0x123c/0x1d80 ? __mutextrylockcommon+0xde/0x250 ? __pfxunregisternetdevicemanynotify+0x10/0x10 ? tracecontentionend+0xe6/0x140 ? __mutex_lock+0x4e7/0x8f0 ? __pfxlockacquire.part.0+0x10/0x10 ? rcuiswatching+0x12/0xc0 ? unregisternetdev+0x12/0x30 unregisternetdevice_queue+0x30d/0x3f0 ? __pfxunregisternetdevice_queue+0x10/0x10 ? __pfxdownwrite+0x10/0x10 unregisternetdev+0x1c/0x30 bnepsession+0x1fb3/0x2ab0 ? __pfxbnepsession+0x10/0x10 ? __pfxlockrelease+0x10/0x10 ? __pfxwokenwake_function+0x10/0x10 ? __kthread_parkme+0x132/0x200 ? __pfxbnepsession+0x10/0x10 ? kthread+0x13a/0x370 ? __pfxbnepsession+0x10/0x10 kthread+0x2b7/0x370 ? __pfxkthread+0x10/0x10 retfrom_fork+0x48/0x80 ? __pfxkthread+0x10/0x10 retfromforkasm+0x1a/0x30 </TASK>

Allocated by task 4974: kasansavestack+0x30/0x50 kasansavetrack+0x14/0x30 __kasan_kmalloc+0xaa/0xb0 __kmallocnoprof+0x1d1/0x440 hciallocdevpriv+0x1d/0x2820 _vhcicreatedevice+0xef/0x7d0 vhciwrite+0x2c7/0x480 vfswrite+0x6a0/0xfc0 ksyswrite+0x12f/0x260 dosyscall64+0xc7/0x250 entrySYSCALL64afterhwframe+0x77/0x7f

Freed by task 4979: kasansavestack+0x30/0x50 kasansavetrack+0x14/0x30 kasansavefree_info+0x3b/0x60 __kasanslabfree+0x4f/0x70 kfree+0x141/0x490 hcireleasedev+0x4d9/0x600 bthostrelease+0x6a/0xb0 devicerelease+0xa4/0x240 kobjectput+0x1ec/0x5a0 putdevice+0x1f/0x30 vhcirelease+0x81/0xf0 __fput+0x3f6/0xb30 taskworkrun+0x151/0x250 doexit+0xa79/0x2c30 dogroupexit+0xd5/0x2a0 getsignal+0x1fcd/0x2210 archdosignalorrestart+0x93/0x780 syscallexittousermode+0x140/0x290 dosyscall64+0xd4/0x250 entrySYSCALL64afterhwframe+0x77/0x7f

In 'hciconndelsysfs()', 'deviceunregister()' may be called when an underlying (kobject) reference counter is greater than 1. This means that reparenting (happened when the device is actually freed) is delayed and, during that delay, parent controller device (hciX) may be deleted. Since the latter may create a dangling pointer to freed parent, avoid that scenario by reparenting to NULL explicitly.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/53xxx/CVE-2024-53237.json",
    "cna_assigner": "Linux"
}
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
3c4236f1b2a715e878a06599fa8b0cc21f165d28
Fixed
6894717a1ea363c5a27010ba604f957c309d282d
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
53d61daf35b1bbf3ae06e852ee107aa2f05b3776
Fixed
fb91ce37dc9a37ea23cf32b6d7b667004e93d4c5
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
ba7088769800d9892a7e4f35c3137a5b3e65410b
Fixed
a9584c897d1cba6265c78010bbb45ca5722c88bc
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
87624b1f9b781549e69f92db7ede012a21cec275
Fixed
0f67ca2a80acf8b207240405b7f72d660665d3df
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
56a4fdde95ed98d864611155f6728983e199e198
Fixed
de5a44f351ca7efd9add9851b218f5353e2224b7
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
a85fb91e3d728bdfc80833167e8162cce8bc7004
Fixed
91e2a2e4d1336333804cd31162984f01ad8cc70f
Fixed
7b277bd569bb6a2777f0014f84b4344f444fd49d
Fixed
27aabf27fd014ae037cc179c61b0bee7cff55b3d
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
5c53afc766e07098429520b7677eaa164b593451
Last affected
fc666d1b47518a18519241cae213de1babd4a4ba

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2024-53237.json"