GHSA-5QMC-RG3W-HX9M
Vulnerability from github – Published: 2026-10-18 18:31 – Updated: 2026-10-18 18:31In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: RFCOMM: fix NULL dereference of dlc->session in RFCOMM_CONNINFO
The RFCOMM_CONNINFO getsockopt handler accepts a socket that is not connected as long as deferred setup is enabled:
if (sk->sk_state != BT_CONNECTED &&
!rfcomm_pi(sk)->dlc->defer_setup) {
err = -ENOTCONN;
break;
}
l2cap_sk = rfcomm_pi(sk)->dlc->session->sock->sk;
dlc->defer_setup is set in rfcomm_sock_init() when rfcomm_connect_ind() creates a child socket for an incoming connection on a listening socket that has BT_DEFER_SETUP enabled. It is never cleared afterwards. The session, however, can go away underneath it.
rfcomm_recv_disc() forces the dlc state before tearing it down:
d->state = BT_CLOSED;
__rfcomm_dlc_close(d, err);
The RFCOMM_DEFER_SETUP early return in __rfcomm_dlc_close() only covers BT_CONNECT, BT_CONFIG, BT_OPEN and BT_CONNECT2, so with the state already BT_CLOSED that switch does not match and the function falls through to rfcomm_dlc_unlink(), which sets d->session = NULL, while d->defer_setup stays 1.
A getsockopt(SOL_RFCOMM, RFCOMM_CONNINFO) on the accepted socket after that point therefore skips the -ENOTCONN path -- sk->sk_state is BT_CLOSED, but dlc->defer_setup is still set -- and dereferences the NULL session. No race is needed: once the DISC has been processed, the dereference is unconditional.
Reproduced on a KASAN kernel under QEMU with a BR/EDR peer emulated over /dev/vhci: the peer brings up an ACL link, opens L2CAP on the RFCOMM PSM, starts a session and sends SABM for a channel bound with BT_DEFER_SETUP, and sends DISC for that dlci after the socket has been accepted. getsockopt(SOL_RFCOMM, RFCOMM_CONNINFO) on the accepted socket then hits:
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000002: 0000 [#1] SMP KASAN PTI KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017] CPU: 1 UID: 0 PID: 150 Comm: init Tainted: G B 7.3.0-rc3-g5dd1818b15d9 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996) RIP: 0010:rfcomm_sock_getsockopt+0x529/0x780 Call Trace: do_sock_getsockopt+0x3ad/0x7d0 __sys_getsockopt+0x10e/0x1b0 __x64_sys_getsockopt+0xc2/0x160 do_syscall_64+0xda/0x4b0 entry_SYSCALL_64_after_hwframe+0x77/0x7f
0x10 is the offset of sock in struct rfcomm_session; rfcomm_sock_getsockopt_old() is inlined into rfcomm_sock_getsockopt().
Commit 43a556b2fd43 ("Bluetooth: RFCOMM: take rfcomm_mutex for the deferred setup accept") fixed the same "a remote DISC clears the session while deferred setup is still flagged" problem in rfcomm_dlc_accept(); this is the remaining instance of it, in the getsockopt path.
Deferred setup only leaves a socket usable here once it has reached BT_CONNECT2, so restrict the exception to that state and check that a session is actually present before following it.
{
"affected": [],
"aliases": [
"CVE-2026-98455"
],
"database_specific": {
"cwe_ids": [],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-10-18T16:16:55Z",
"severity": null
},
"details": "In the Linux kernel, the following vulnerability has been resolved:\n\nBluetooth: RFCOMM: fix NULL dereference of dlc-\u003esession in RFCOMM_CONNINFO\n\nThe RFCOMM_CONNINFO getsockopt handler accepts a socket that is not\nconnected as long as deferred setup is enabled:\n\n\tif (sk-\u003esk_state != BT_CONNECTED \u0026\u0026\n\t\t\t\t!rfcomm_pi(sk)-\u003edlc-\u003edefer_setup) {\n\t\terr = -ENOTCONN;\n\t\tbreak;\n\t}\n\tl2cap_sk = rfcomm_pi(sk)-\u003edlc-\u003esession-\u003esock-\u003esk;\n\ndlc-\u003edefer_setup is set in rfcomm_sock_init() when rfcomm_connect_ind()\ncreates a child socket for an incoming connection on a listening socket\nthat has BT_DEFER_SETUP enabled. It is never cleared afterwards. The\nsession, however, can go away underneath it.\n\nrfcomm_recv_disc() forces the dlc state before tearing it down:\n\n\td-\u003estate = BT_CLOSED;\n\t__rfcomm_dlc_close(d, err);\n\nThe RFCOMM_DEFER_SETUP early return in __rfcomm_dlc_close() only covers\nBT_CONNECT, BT_CONFIG, BT_OPEN and BT_CONNECT2, so with the state\nalready BT_CLOSED that switch does not match and the function falls\nthrough to rfcomm_dlc_unlink(), which sets d-\u003esession = NULL, while\nd-\u003edefer_setup stays 1.\n\nA getsockopt(SOL_RFCOMM, RFCOMM_CONNINFO) on the accepted socket after\nthat point therefore skips the -ENOTCONN path -- sk-\u003esk_state is\nBT_CLOSED, but dlc-\u003edefer_setup is still set -- and dereferences the\nNULL session. No race is needed: once the DISC has been processed, the\ndereference is unconditional.\n\nReproduced on a KASAN kernel under QEMU with a BR/EDR peer emulated over\n/dev/vhci: the peer brings up an ACL link, opens L2CAP on the RFCOMM\nPSM, starts a session and sends SABM for a channel bound with\nBT_DEFER_SETUP, and sends DISC for that dlci after the socket has been\naccepted. getsockopt(SOL_RFCOMM, RFCOMM_CONNINFO) on the accepted\nsocket then hits:\n\n Oops: general protection fault, probably for non-canonical address\n 0xdffffc0000000002: 0000 [#1] SMP KASAN PTI\n KASAN: null-ptr-deref in range [0x0000000000000010-0x0000000000000017]\n CPU: 1 UID: 0 PID: 150 Comm: init Tainted: G B 7.3.0-rc3-g5dd1818b15d9\n Hardware name: QEMU Standard PC (i440FX + PIIX, 1996)\n RIP: 0010:rfcomm_sock_getsockopt+0x529/0x780\n Call Trace:\n \u003cTASK\u003e\n do_sock_getsockopt+0x3ad/0x7d0\n __sys_getsockopt+0x10e/0x1b0\n __x64_sys_getsockopt+0xc2/0x160\n do_syscall_64+0xda/0x4b0\n entry_SYSCALL_64_after_hwframe+0x77/0x7f\n \u003c/TASK\u003e\n\n0x10 is the offset of sock in struct rfcomm_session;\nrfcomm_sock_getsockopt_old() is inlined into rfcomm_sock_getsockopt().\n\nCommit 43a556b2fd43 (\"Bluetooth: RFCOMM: take rfcomm_mutex for the\ndeferred setup accept\") fixed the same \"a remote DISC clears the session\nwhile deferred setup is still flagged\" problem in rfcomm_dlc_accept();\nthis is the remaining instance of it, in the getsockopt path.\n\nDeferred setup only leaves a socket usable here once it has reached\nBT_CONNECT2, so restrict the exception to that state and check that a\nsession is actually present before following it.",
"id": "GHSA-5qmc-rg3w-hx9m",
"modified": "2026-10-18T18:31:49Z",
"published": "2026-10-18T18:31:49Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-98455"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/005b23d9e324fe5d0acbcfa70c625f2e81189046"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/1c4f7e1177da2f229be04139c27e5370a1cfba52"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/46f8ffd0a1f1eb6cbc94946a92c11ef601e228a1"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/4bf5ca47203049ce3648f750a53dcdc98bcc9e3e"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/84ae3cfd7d3a63591a2eb4faa24faf678c6708aa"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/8f5b30cc12c409ff62891e47ed51e6bf0945a3ea"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/c3aee3fc1287c8a555baf3895959087cb0c33fe8"
},
{
"type": "WEB",
"url": "https://git.kernel.org/stable/c/c7362f6a18ed167f52f08ce25eeec8a7818c5004"
}
],
"schema_version": "1.4.0",
"severity": []
}
Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
Vulnerability timeline
Sightings and recorded dates, grouped by day · UTC
Loading timeline…
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.