CARVIEW |
Select Language
HTTP/2 200
date: Thu, 31 Jul 2025 07:40:33 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"209693ba0f811df4c728fe6016603b78"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=7tsSTJ6p1TQ3TH4QYpUZ6VMJyWvVYl3YLOVzy5wRA8a7Ip%2FeIUlh8fKUaKRtvu3q%2BEnFakCY3rreFmEQTHEuWkNMOQYyf2lts1usD5alkDRSLkExFEaVDrIb1yi0tVkXnp65XSkuHRbCfo1WewIkVBnFjRAkmdFK70vWGtbV7zkg1ypMnK8LatjHBrOp3iz541fNA1ZzYIQxfbxdeZqVFoVhXP75btIbVt%2Fz0nURgX9jMWATrTWzKnjtqEN9nHDaikXhalv%2FYT6%2BaYtif4CoLw%3D%3D--vRKdGwGnZR%2B1XDEi--j5lLXPUsp33slic%2FOOSF7Q%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1933861718.1753947633; Path=/; Domain=github.com; Expires=Fri, 31 Jul 2026 07:40:33 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Fri, 31 Jul 2026 07:40:33 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: C4F0:3BDB3D:552144:6A8988:688B1DF1
Linux Kernel: UAF in Bluetooth L2CAP Handshake · Advisory · google/security-research · GitHub
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 480
Linux Kernel: UAF in Bluetooth L2CAP Handshake
Moderate
Package
Kernel
(Linux)
Affected versions
> v3.16.0
Patched versions
None
Description
Severity
Moderate
CVE ID
CVE-2022-42896
Weaknesses
No CWEs
Credits
-
koczkatamas Analyst
-
TheOfficialFloW Analyst
You can’t perform that action at this time.
Summary
There are use-after-free vulnerabilities in the Linux kernel's
net/bluetooth/l2cap_core.c
'sl2cap_connect
andl2cap_le_connect_req
functions which may allow code execution and leaking kernel memory (respectively) remotely via Bluetooth.The
l2cap_le_connect_req
bug was introduced in commit 27e2d4c (version: 3.12.0, date: 2013-Dec-05), the SMP channel is available since commit 70db83c (version: 3.16.0, date: 2014-Aug-14).Severity
Moderate
Proof of Concept
UAF read in l2cap_le_connect_req
UAF write in l2cap_connect
To make SMP available for BR/EDR devices (in case of a hardware supporting it is not available), you can force it by running:
echo Y > /sys/kernel/debug/bluetooth/hci0/force_bredr_smp
Further Analysis
Bug Analysis
There are UAF races in l2cap_connect and l2cap_le_connect_req methods. After a channel is created via the
new_connection
callback, it is not locked but__set_chan_timer
sets up a timer which can calll2cap_chan_timeout
and can cleanup the channel before the method finishes, causing UAF read in l2cap_le_connect_req and UAF write in l2cap_connect.As the channel timeout is normally 40 seconds (
L2CAP_CONN_TIMEOUT
), winning the race would be infeasible, but due to a bug in SMP's implementation, SMP channels created by smp_new_conn_cb have theirget_sndtimeo
callback set tol2cap_chan_no_get_sndtimeo
which returns 0 as timeout value thus causing the timer to run immediately (on a different thread) after the__set_chan_timer
call.Note: in
l2cap_le_connect_req
(withoutFLAG_DEFER_SETUP
), the timer is canceled via thel2cap_chan_ready
call almost immediately after the__set_chan_timer
call, but even this small time window enough for the timer with 0 timeout to start.Another root cause of the issue can be that the SMP channel is available via
l2cap_global_chan_by_psm
if the request containspsm=0
. Multiple channels can be registered without PSM (PSM is 0, and channel is identified by SCID) but only one of them is returned (which needs to be SMP to be able to trigger the vulnerability).Similar issue within
l2cap_connect
:The affected code path in SMP implementation:
Reachability
SMP channel is available for Bluetooth Low Energy since BT 4.0 (~2009) which can be used to trigger the UAF read in
l2cap_le_connect_req
, and it is also available for BT BR/EDR since BT 5.2 (~2020, to support Secure Connections) to trigger the UAF write inl2cap_connect
.No other prerequisites were found, the bugs were triggered on a KASAN-enabled Ubuntu 22.04 kernel (an artificial delay was added before the UAF read/write to make winning the race easier).
Note: it is possible that the bugs can be triggered via other channels which may be created automatically by the specific environment.
Patch
The vulnerability was fixed by not accepting 0 as a valid PSM value in commit 711f8c3 and by preventing
l2cap_global_chan_by_psm
to give backL2CAP_CHAN_FIXED
channels in commit f937b75.Timeline
Date reported: 10/06/2022
Date fixed: 10/26/2022
Date disclosed: 11/28/2022