Bluetooth: l2cap: fix null-ptr-deref in l2cap_chan_timeout
In the Linux kernel, the following vulnerability has been resolved: Bluetooth: l2cap: fix null-ptr-deref in l2cap_chan_timeout There is a race condition between l2cap_chan_timeout() and l2cap_chan_del(). When we use l2cap_chan_del() to delete the channel, the chan->conn will be set to null. But the conn could be dereferenced again in the mutex_lock() of l2cap_chan_timeout(). As a result the null pointer dereference bug will happen. The KASAN report triggered by POC is shown below: [ 472.074580] ================================================================== [ 472.075284] BUG: KASAN: null-ptr-deref in mutex_lock+0x68/0xc0 [ 472.075308] Write of size 8 at addr 0000000000000158 by task kworker/0:0/7 [ 472.075308] [ 472.075308] CPU: 0 PID: 7 Comm: kworker/0:0 Not tainted 6.9.0-rc5-00356-g78c0094a146b #36 [ 472.075308] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu4 [ 472.075308] Workqueue: events l2cap_chan_timeout [ 472.075308] Call Trace: [ 472.075308] [ 472.075308] dump_stack_lvl+0x137/0x1a0 [ 472.075308] print_report+0x101/0x250 [ 472.075308] ? __virt_addr_valid+0x77/0x160 [ 472.075308] ? mutex_lock+0x68/0xc0 [ 472.075308] kasan_report+0x139/0x170 [ 472.075308] ? mutex_lock+0x68/0xc0 [ 472.075308] kasan_check_range+0x2c3/0x2e0 [ 472.075308] mutex_lock+0x68/0xc0 [ 472.075308] l2cap_chan_timeout+0x181/0x300 [ 472.075308] process_one_work+0x5d2/0xe00 [ 472.075308] worker_thread+0xe1d/0x1660 [ 472.075308] ? pr_cont_work+0x5
- Products
- Kernel
- Affected versions
- Not specified
- Fixed versions
- 4.19.314, 5.10.217, 5.15.159, 5.4.276, 6.1.91, 6.6.31, 6.8.10
- CVEs
- CVE-2024-27399
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 5 Nov 2026, 03:17 UTC · Revision 1
Source evidence
Bluetooth: l2cap: fix null-ptr-deref in l2cap_chan_timeout
core-osv · Original sourcePublished 13 May 2024, 10:24 UTC
In the Linux kernel, the following vulnerability has been resolved: Bluetooth: l2cap: fix null-ptr-deref in l2cap_chan_timeout There is a race condition between l2cap_chan_timeout() and l2cap_chan_del(). When we use l2cap_chan_del() to delete the channel, the chan->conn will be set to null. But the conn could be dereferenced again in the mutex_lock() of l2cap_chan_timeout(). As a result the null pointer dereference bug will happen. The KASAN report triggered by POC is shown below: [ 472.074580] ================================================================== [ 472.075284] BUG: KASAN: null-ptr-deref in mutex_lock+0x68/0xc0 [ 472.075308] Write of size 8 at addr 0000000000000158 by task kworker/0:0/7 [ 472.075308] [ 472.075308] CPU: 0 PID: 7 Comm: kworker/0:0 Not tainted 6.9.0-rc5-00356-g78c0094a146b #36 [ 472.075308] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu4 [ 472.075308] Workqueue: events l2cap_chan_timeout [ 472.075308] Call Trace: [ 472.075308] [ 472.075308] dump_stack_lvl+0x137/0x1a0 [ 472.075308] print_report+0x101/0x250 [ 472.075308] ? __virt_addr_valid+0x77/0x160 [ 472.075308] ? mutex_lock+0x68/0xc0 [ 472.075308] kasan_report+0x139/0x170 [ 472.075308] ? mutex_lock+0x68/0xc0 [ 472.075308] kasan_check_range+0x2c3/0x2e0 [ 472.075308] mutex_lock+0x68/0xc0 [ 472.075308] l2cap_chan_timeout+0x181/0x300 [ 472.075308] process_one_work+0x5d2/0xe00 [ 472.075308] worker_thread+0xe1d/0x1660 [ 472.075308] ? pr_cont_work+0x5
osv:CVE-2024-27399
Kernel
Fixed versions: 4.19.314, 5.4.276, 5.10.217, 5.15.159, 6.1.91, 6.6.31, 6.8.10
Complete source record
{
"id": "524d15b8bff7929ee1dead63e3c53ee31d11da6da4e2b4e1ce22b86dc629f79a",
"url": "https://osv.dev/vulnerability/CVE-2024-27399",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Bluetooth: l2cap: fix null-ptr-deref in l2cap_chan_timeout",
"summary": "In the Linux kernel, the following vulnerability has been resolved: Bluetooth: l2cap: fix null-ptr-deref in l2cap_chan_timeout There is a race condition between l2cap_chan_timeout() and l2cap_chan_del(). When we use l2cap_chan_del() to delete the channel, the chan->conn will be set to null. But the conn could be dereferenced again in the mutex_lock() of l2cap_chan_timeout(). As a result the null pointer dereference bug will happen. The KASAN report triggered by POC is shown below: [ 472.074580] ================================================================== [ 472.075284] BUG: KASAN: null-ptr-deref in mutex_lock+0x68/0xc0 [ 472.075308] Write of size 8 at addr 0000000000000158 by task kworker/0:0/7 [ 472.075308] [ 472.075308] CPU: 0 PID: 7 Comm: kworker/0:0 Not tainted 6.9.0-rc5-00356-g78c0094a146b #36 [ 472.075308] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu4 [ 472.075308] Workqueue: events l2cap_chan_timeout [ 472.075308] Call Trace: [ 472.075308] [ 472.075308] dump_stack_lvl+0x137/0x1a0 [ 472.075308] print_report+0x101/0x250 [ 472.075308] ? __virt_addr_valid+0x77/0x160 [ 472.075308] ? mutex_lock+0x68/0xc0 [ 472.075308] kasan_report+0x139/0x170 [ 472.075308] ? mutex_lock+0x68/0xc0 [ 472.075308] kasan_check_range+0x2c3/0x2e0 [ 472.075308] mutex_lock+0x68/0xc0 [ 472.075308] l2cap_chan_timeout+0x181/0x300 [ 472.075308] process_one_work+0x5d2/0xe00 [ 472.075308] worker_thread+0xe1d/0x1660 [ 472.075308] ? pr_cont_work+0x5",
"evidence": "osv:CVE-2024-27399",
"products": [
{
"name": {
"value": "Kernel",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [
{
"value": "4.19.314",
"evidence": "/affected/1/ranges"
},
{
"value": "5.4.276",
"evidence": "/affected/1/ranges"
},
{
"value": "5.10.217",
"evidence": "/affected/1/ranges"
},
{
"value": "5.15.159",
"evidence": "/affected/1/ranges"
},
{
"value": "6.1.91",
"evidence": "/affected/1/ranges"
},
{
"value": "6.6.31",
"evidence": "/affected/1/ranges"
},
{
"value": "6.8.10",
"evidence": "/affected/1/ranges"
}
],
"affected_versions": []
}
],
"severity": "unknown",
"structured": {
"id": "CVE-2024-27399",
"aliases": [
"CVE-2024-27399"
],
"affected": [
{
"ranges": [
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"type": "GIT",
"events": [
{
"introduced": "3df91ea20e744344100b10ae69a17211fcf5b207"
},
{
"fixed": "e137e2ba96e51902dc2878131823a96bf8e638ae"
},
{
"fixed": "6466ee65e5b27161c846c73ef407f49dfa1bd1d9"
},
{
"fixed": "06acb75e7ed600d0bbf7bff5628aa8f24a97978c"
},
{
"fixed": "e97e16433eb4533083b096a3824b93a5ca3aee79"
},
{
"fixed": "8960ff650aec70485b40771cd8e6e8c4cb467d33"
},
{
"fixed": "955b5b6c54d95b5e7444dfc81c95c8e013f27ac0"
},
{
"fixed": "eb86f955488c39526534211f2610e48a5cf8ead4"
},
{
"fixed": "adf0398cee86643b8eacde95f17d073d022f782c"
}
]
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-27399.json"
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "3.4.0"
},
{
"fixed": "4.19.314"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "4.20.0"
},
{
"fixed": "5.4.276"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.5.0"
},
{
"fixed": "5.10.217"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.11.0"
},
{
"fixed": "5.15.159"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "5.16.0"
},
{
"fixed": "6.1.91"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.2.0"
},
{
"fixed": "6.6.31"
}
]
},
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "6.7.0"
},
{
"fixed": "6.8.10"
}
]
}
],
"package": {
"name": "Kernel",
"ecosystem": "Linux"
},
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-27399.json"
}
}
],
"modified": "2026-10-28T02:30:42.312551845Z",
"provider": "osv",
"references": [
"https://git.kernel.org/stable/c/06acb75e7ed600d0bbf7bff5628aa8f24a97978c",
"https://git.kernel.org/stable/c/6466ee65e5b27161c846c73ef407f49dfa1bd1d9",
"https://git.kernel.org/stable/c/8960ff650aec70485b40771cd8e6e8c4cb467d33",
"https://git.kernel.org/stable/c/955b5b6c54d95b5e7444dfc81c95c8e013f27ac0",
"https://git.kernel.org/stable/c/adf0398cee86643b8eacde95f17d073d022f782c",
"https://git.kernel.org/stable/c/e137e2ba96e51902dc2878131823a96bf8e638ae",
"https://git.kernel.org/stable/c/e97e16433eb4533083b096a3824b93a5ca3aee79",
"https://git.kernel.org/stable/c/eb86f955488c39526534211f2610e48a5cf8ead4",
"https://lists.debian.org/debian-lts-announce/2024/06/msg00019.html",
"https://lists.debian.org/debian-lts-announce/2024/06/msg00020.html",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DW2MIOIMOFUSNLHLRYX23AFR36BMKD65/",
"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/OTB4HWU2PTVW5NEYHHLOCXDKG3PYA534/",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/27xxx/CVE-2024-27399.json",
"https://nvd.nist.gov/vuln/detail/CVE-2024-27399",
"https://security.netapp.com/advisory/ntap-20240926-0001/",
"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
],
"provider_metadata": {
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/27xxx/CVE-2024-27399.json"
}
},
"related_cves": [
{
"value": "CVE-2024-27399",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": null
},
"source_id": "core-osv",
"document_id": 509795,
"published_at": "2024-05-13T10:24:57.045+00:00"
}