CVE-2024-36013

Source
https://cve.org/CVERecord?id=CVE-2024-36013
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-36013.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2024-36013
Downstream
Related
Published
2024-05-23T07:03:07.571Z
Modified
2026-03-23T05:07:28.531620085Z
Severity
  • 6.8 (Medium) CVSS_V3 - CVSS:3.1/AV:A/AC:H/PR:L/UI:R/S:U/C:H/I:H/A:H CVSS Calculator
Summary
Bluetooth: L2CAP: Fix slab-use-after-free in l2cap_connect()
Details

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

Bluetooth: L2CAP: Fix slab-use-after-free in l2cap_connect()

Extend a critical section to prevent chan from early freeing. Also make the l2cap_connect() return type void. Nothing is using the returned value but it is ugly to return a potentially freed pointer. Making it void will help with backports because earlier kernels did use the return value. Now the compile will break for kernels where this patch is not a complete fix.

Call stack summary:

[use] l2capbredrsigcmd l2capconnect ┌ mutexlock(&conn->chanlock); │ chan = pchan->ops->new_connection(pchan); <- alloc chan │ _l2capchanadd(conn, chan); │ l2capchanhold(chan); │ listadd(&chan->list, &conn->chanl); ... (1) └ mutexunlock(&conn->chanlock); chan->confstate ... (4) <- use after free

[free] l2capconndel ┌ mutexlock(&conn->chanlock); │ foreach chan in conn->chanl: ... (2) │ l2capchanput(chan); │ l2capchandestroy │ kfree(chan) ... (3) <- chan freed └ mutexunlock(&conn->chan_lock);

================================================================== BUG: KASAN: slab-use-after-free in instrumentatomicread include/linux/instrumented.h:68 [inline] BUG: KASAN: slab-use-after-free in testbit include/asm-generic/bitops/instrumented-non-atomic.h:141 [inline] BUG: KASAN: slab-use-after-free in l2capconnect+0xa67/0x11a0 net/bluetooth/l2capcore.c:4260 Read of size 8 at addr ffff88810bf040a0 by task kworker/u3:1/311

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/36xxx/CVE-2024-36013.json"
}
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
73ffa904b78287f6acf8797e040150aa26a4af4a
Fixed
cfe560c7050bfb37b0d2491bbe7cd8b59e77fdc5
Fixed
826af9d2f69567c646ff46d10393d47e30ad23c6
Fixed
4d7b41c0e43995b0e992b9f8903109275744b658

Database specific

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