Description (CNA)
In the Linux kernel, the following vulnerability has been resolved: Bluetooth: L2CAP: access chan->conn safely in get/setsockopt Since commit b66774b48dd9 ("Bluetooth: L2CAP: Fix UAF in channel timeout by holding conn ref") l2cap_chan::conn has held reference and remains non-NULL also after the corresponding hci_conn is deleted. In this state accessing various fields eg. hci_conn::hdev is invalid, which leads to KASAN crash in l2cap_sock_setsockopt() access of conn->hcon->hdev. Check l2cap_chan::conn.hcon corresponds to an alive hci_conn before trying to use it in l2cap_sock.c. Hold l2cap_chan_lock() in getsockopt/setsockopt to ensure it stays alive, and to avoid data races in l2cap_chan fields.
Affected (CNA)
| Vendor / product | Versions |
|---|---|
| Linux / Linux | affected 91047a4396a8b1857a6f712a90cf33ec0012b189 before 19e154d794eb4d33d99ca4a087b1cea9d5e65786; affected 0b0e2bf39cf99e458d991b9df253727e036a7d7d before 3af72bf8f73c519ee562e6963d5ff8e678924f93; affected d3b739db5dc6f688a60d56da872fabaf65246032 before 8460dc49c9756a1e9288218060b4d41e1b704905; affected b66774b48dd98f07254951f74ea6f513efe7ff8b before f49321c85785178214fd67f2e9b4b73d6363783b; affected b66774b48dd98f07254951f74ea6f513efe7ff8b before ca2c4c26498643f421d35ffe258fafbd3ed461c3; affected 8f90405a4a6f1f1880dc07996b47bf57c712bd8a; affected 32d783cafb46ff3ca58e6f9fd62c9c5f35eaf26b; affected 8922c7940bae9ce4b1736dddb6362370793835c2; affected 50c38d9f42a529691e4e67ea9cedf4f0bfc8d277; affected 6.6.145 before 6.6.160; affected 6.12.97 before 6.12.114; affected 6.18.39 before 6.18.57; affected 5.10.265 before 5.11; affected 5.15.216 before 5.16; affected 6.1.183 before 6.2; affected 7.1.4 before 7.2 |
| Linux / Linux | affected 7.2; unaffected 0 before 7.2; unaffected 6.6.160 through 6.6.*; unaffected 6.12.114 through 6.12.*; unaffected 6.18.57 through 6.18.*; unaffected 7.2.6 through 7.2.*; unaffected 7.3 through * |
CWE
No CWE identifiers supplied.
References
- https://git.kernel.org/stable/c/19e154d794eb4d33d99ca4a087b1cea9d5e65786
- https://git.kernel.org/stable/c/3af72bf8f73c519ee562e6963d5ff8e678924f93
- https://git.kernel.org/stable/c/8460dc49c9756a1e9288218060b4d41e1b704905
- https://git.kernel.org/stable/c/f49321c85785178214fd67f2e9b4b73d6363783b
- https://git.kernel.org/stable/c/ca2c4c26498643f421d35ffe258fafbd3ed461c3