Description
In the Linux kernel, the following vulnerability has been resolved: Bluetooth: L2CAP: Fix use-after-free in l2cap_sock_new_connection_cb() l2cap_sock_new_connection_cb() returned l2cap_pi(sk)->chan after release_sock(parent). Once the parent lock is dropped the newly enqueued child socket sk is reachable via the accept queue, so another task can accept and free it before the callback dereferences sk, resulting in a use-after-free. Rework the ->new_connection() op so the core, rather than the callback, owns the child channel's lifetime. The op now receives a pre-allocated new_chan and returns an errno instead of allocating and returning a channel. l2cap_new_connection() allocates the child channel and links it into the conn list via __l2cap_chan_add() before invoking the callback, so the conn-list reference keeps the channel alive once release_sock(parent) exposes the socket to other tasks. Channel configuration that was duplicated in l2cap_sock_init() and the various new_connection callbacks is consolidated into l2cap_chan_set_defaults(), which now inherits from the parent channel when one is supplied.
Affected products
Version statuses are supplied by the assigning organization. Consult the original record for detailed ranges and platform conditions.
Linux Linux
Default version status: unaffected
8ffb929098a56939ac71509302eeab5b207bf262 to < b39298044e5534612511a2ff5de03ba5f6e7a820affected8ffb929098a56939ac71509302eeab5b207bf262 to < 8c37e4338c801ebb8cee52436c01c41e009f6e87affected8ffb929098a56939ac71509302eeab5b207bf262 to < 84e718b6a814edc84159361f9f454a4e92ae91aeaffected8ffb929098a56939ac71509302eeab5b207bf262 to < 36da806f7fbaee56ad9e81859deec203f9728700affected8ffb929098a56939ac71509302eeab5b207bf262 to < 733e76e74e406c1d1ddc7369420dd8a47f48bb8aaffected8ffb929098a56939ac71509302eeab5b207bf262 to < 6fef032af0092ed5ccb767239a9ac1bc38c08a40affected
Linux Linux
Default version status: affected
3.13affected0 to < 3.13unaffected6.1.178 to ≤ 6.1.*unaffected6.6.145 to ≤ 6.6.*unaffected6.12.97 to ≤ 6.12.*unaffected6.18.40 to ≤ 6.18.*unaffected7.1.5 to ≤ 7.1.*unaffected7.2 to ≤ *unaffected
References
- https://git.kernel.org/stable/c/b39298044e5534612511a2ff5de03ba5f6e7a820 ↗
- https://git.kernel.org/stable/c/8c37e4338c801ebb8cee52436c01c41e009f6e87 ↗
- https://git.kernel.org/stable/c/84e718b6a814edc84159361f9f454a4e92ae91ae ↗
- https://git.kernel.org/stable/c/36da806f7fbaee56ad9e81859deec203f9728700 ↗
- https://git.kernel.org/stable/c/733e76e74e406c1d1ddc7369420dd8a47f48bb8a ↗
- https://git.kernel.org/stable/c/6fef032af0092ed5ccb767239a9ac1bc38c08a40 ↗