{"id":"CVE-2024-56605","state":"PUBLISHED","title":"Bluetooth: L2CAP: do not leave dangling sk pointer on error in l2cap_sock_create()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nBluetooth: L2CAP: do not leave dangling sk pointer on error in l2cap_sock_create()\n\nbt_sock_alloc() allocates the sk object and attaches it to the provided\nsock object. On error l2cap_sock_alloc() frees the sk object, but the\ndangling pointer is still attached to the sock object, which may create\nuse-after-free in other code.","publishedAt":"2024-12-27T14:51:10.344Z","updatedAt":"2026-08-05T11:45:26.035Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"49dfbb9129c4edb318578de35cc45c555df37884","status":"affected","lessThan":"f6ad641646b67f29c7578dcd6c25813c7dcbf51e","versionType":"git"},{"version":"49dfbb9129c4edb318578de35cc45c555df37884","status":"affected","lessThan":"daa13175a6dea312a76099066cb4cbd4fc959a84","versionType":"git"},{"version":"49dfbb9129c4edb318578de35cc45c555df37884","status":"affected","lessThan":"a8677028dd5123e5e525b8195483994d87123de4","versionType":"git"},{"version":"49dfbb9129c4edb318578de35cc45c555df37884","status":"affected","lessThan":"bb2f2342a6ddf7c04f9aefbbfe86104cd138e629","versionType":"git"},{"version":"49dfbb9129c4edb318578de35cc45c555df37884","status":"affected","lessThan":"8ad09ddc63ace3950ac43db6fbfe25b40f589dd6","versionType":"git"},{"version":"49dfbb9129c4edb318578de35cc45c555df37884","status":"affected","lessThan":"61686abc2f3c2c67822aa23ce6f160467ec83d35","versionType":"git"},{"version":"49dfbb9129c4edb318578de35cc45c555df37884","status":"affected","lessThan":"7c4f78cdb8e7501e9f92d291a7d956591bf73be9","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/bluetooth/l2cap_sock.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.6","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.6","versionType":"semver"},{"version":"5.4.287","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.231","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.174","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.120","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.66","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.5","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/bluetooth/l2cap_sock.c"]}],"references":["https://git.kernel.org/stable/c/f6ad641646b67f29c7578dcd6c25813c7dcbf51e","https://git.kernel.org/stable/c/daa13175a6dea312a76099066cb4cbd4fc959a84","https://git.kernel.org/stable/c/a8677028dd5123e5e525b8195483994d87123de4","https://git.kernel.org/stable/c/bb2f2342a6ddf7c04f9aefbbfe86104cd138e629","https://git.kernel.org/stable/c/8ad09ddc63ace3950ac43db6fbfe25b40f589dd6","https://git.kernel.org/stable/c/61686abc2f3c2c67822aa23ce6f160467ec83d35","https://git.kernel.org/stable/c/7c4f78cdb8e7501e9f92d291a7d956591bf73be9","https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html","https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html"],"weaknesses":["CWE-416"],"ingestedAt":"2026-10-29T20:08:12.933Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2024/56xxx/CVE-2024-56605.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2024-56605","state":"PUBLISHED","datePublished":"2024-12-27T14:51:10.344Z","dateUpdated":"2026-08-05T11:45:26.035Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-12-27T14:03:06.013Z"},"containers":{"cna":{"title":"Bluetooth: L2CAP: do not leave dangling sk pointer on error in l2cap_sock_create()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nBluetooth: L2CAP: do not leave dangling sk pointer on error in l2cap_sock_create()\n\nbt_sock_alloc() allocates the sk object and attaches it to the provided\nsock object. On error l2cap_sock_alloc() frees the sk object, but the\ndangling pointer is still attached to the sock object, which may create\nuse-after-free in other code."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"49dfbb9129c4edb318578de35cc45c555df37884","status":"affected","lessThan":"f6ad641646b67f29c7578dcd6c25813c7dcbf51e","versionType":"git"},{"version":"49dfbb9129c4edb318578de35cc45c555df37884","status":"affected","lessThan":"daa13175a6dea312a76099066cb4cbd4fc959a84","versionType":"git"},{"version":"49dfbb9129c4edb318578de35cc45c555df37884","status":"affected","lessThan":"a8677028dd5123e5e525b8195483994d87123de4","versionType":"git"},{"version":"49dfbb9129c4edb318578de35cc45c555df37884","status":"affected","lessThan":"bb2f2342a6ddf7c04f9aefbbfe86104cd138e629","versionType":"git"},{"version":"49dfbb9129c4edb318578de35cc45c555df37884","status":"affected","lessThan":"8ad09ddc63ace3950ac43db6fbfe25b40f589dd6","versionType":"git"},{"version":"49dfbb9129c4edb318578de35cc45c555df37884","status":"affected","lessThan":"61686abc2f3c2c67822aa23ce6f160467ec83d35","versionType":"git"},{"version":"49dfbb9129c4edb318578de35cc45c555df37884","status":"affected","lessThan":"7c4f78cdb8e7501e9f92d291a7d956591bf73be9","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/bluetooth/l2cap_sock.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"3.6","status":"affected"},{"version":"0","status":"unaffected","lessThan":"3.6","versionType":"semver"},{"version":"5.4.287","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.231","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.174","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.1.120","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.66","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.5","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.13","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/bluetooth/l2cap_sock.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/f6ad641646b67f29c7578dcd6c25813c7dcbf51e"},{"url":"https://git.kernel.org/stable/c/daa13175a6dea312a76099066cb4cbd4fc959a84"},{"url":"https://git.kernel.org/stable/c/a8677028dd5123e5e525b8195483994d87123de4"},{"url":"https://git.kernel.org/stable/c/bb2f2342a6ddf7c04f9aefbbfe86104cd138e629"},{"url":"https://git.kernel.org/stable/c/8ad09ddc63ace3950ac43db6fbfe25b40f589dd6"},{"url":"https://git.kernel.org/stable/c/61686abc2f3c2c67822aa23ce6f160467ec83d35"},{"url":"https://git.kernel.org/stable/c/7c4f78cdb8e7501e9f92d291a7d956591bf73be9"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The vulnerable path is entered only from the local `socket(AF_BLUETOOTH, SOCK_SEQPACKET, BTPROTO_L2CAP)` syscall via `__sock_create()` → `bt_sock_create()` → `l2cap_sock_create()`; no remote or adjacent Bluetooth peer data is involved, since the inbound-connection caller `l2cap_sock_new_connection_cb()` passes `sock == NULL` and never sets a dangling pointer.\nAC:L - The sole precondition is failure of `kzalloc(sizeof(*chan), GFP_ATOMIC)` in `l2cap_chan_create()`, and the attacker controls both sides — driving system memory pressure with their own allocations (GFP_ATOMIC has no reclaim fallback and fails readily under pressure) while looping on `socket()` from many threads, retrying indefinitely at no cost. No race the attacker cannot influence and no unpredictable memory layout is required.\nPR:L - `l2cap_sock_create()` imposes no capability check for SOCK_SEQPACKET/SOCK_STREAM/SOCK_DGRAM — `CAP_NET_RAW` gates only SOCK_RAW and `CAP_NET_BIND_SERVICE` applies later at `bind()` — so any unprivileged local user on a Bluetooth-enabled system can reach the allocation failure path.\nUI:N - The attacker triggers the entire sequence themselves with a single syscall under self-induced memory pressure; no victim must open a file, pair a device, or take any other action.\nS:U - The freed `struct sock`, the stale `sock->sk` reference, and every downstream effect remain within the kernel's own security authority — no hypervisor, IOMMU, or sandbox boundary is crossed.\nC:H - `sock->sk` is left pointing at slab memory freed by `sk_free()`, and `__sock_create()`'s error path skips the `sock->sk = NULL` clearing in `__sock_release()` (it sits inside the `if (ops)` block after `sock->ops = NULL`), so any subsequent dereference reads freed memory — as KASAN-confirmed in the parent fix, `__sock_gen_cookie()` performs an 8-byte read of the dead object, and the attacker can reclaim that `l2cap_pinfo`-sized slab object by heap spray to control and disclose its contents.\nI:H - The same dangling pointer yields a write primitive, not just a read: `__sock_gen_cookie()` issues `atomic64_cmpxchg(&sk->sk_cookie, ...)` into the freed object at a fixed offset, corrupting whatever attacker-groomed structure has reclaimed that slot — a classic use-after-free write usable for control-flow hijacking.\nA:H - Use of the freed `struct sock` corrupts the slab allocator and produces oops or panic even when not weaponized; additionally the `DEBUG_NET_WARN_ONCE(sock->sk, ...)` added to `__sock_create()` for exactly this bug class fires on CONFIG_DEBUG_NET kernels, which is fatal under `panic_on_warn`."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T11:45:26.035Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.6","versionEndExcluding":"5.4.287"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.6","versionEndExcluding":"5.10.231"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.6","versionEndExcluding":"5.15.174"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.6","versionEndExcluding":"6.1.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.6","versionEndExcluding":"6.6.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.6","versionEndExcluding":"6.12.5"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"3.6","versionEndExcluding":"6.13"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"cvssV3_1":{"scope":"UNCHANGED","version":"3.1","baseScore":7.8,"attackVector":"LOCAL","baseSeverity":"HIGH","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","integrityImpact":"HIGH","userInteraction":"NONE","attackComplexity":"LOW","availabilityImpact":"HIGH","privilegesRequired":"LOW","confidentialityImpact":"HIGH"}},{"other":{"type":"ssvc","content":{"id":"CVE-2024-56605","role":"CISA Coordinator","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"total"}],"version":"2.0.3","timestamp":"2025-02-11T15:42:08.177341Z"}}}],"problemTypes":[{"descriptions":[{"cweId":"CWE-416","lang":"en","type":"CWE","description":"CWE-416 Use After Free"}]}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2025-02-11T15:45:22.950Z"}},{"title":"CVE Program Container","references":[{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00001.html"},{"url":"https://lists.debian.org/debian-lts-announce/2025/03/msg00002.html"}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2025-11-03T20:50:51.126Z"}}]}}}