This is a note to let you know that I've just added the patch titled Bluetooth: L2CAP: Fix attempting to access uninitialized memory to the 6.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: bluetooth-l2cap-fix-attempting-to-access-uninitialized-memory.patch and it can be found in the queue-6.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From b1a2cd50c0357f243b7435a732b4e62ba3157a2e Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> Date: Mon, 31 Oct 2022 16:10:52 -0700 Subject: Bluetooth: L2CAP: Fix attempting to access uninitialized memory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> commit b1a2cd50c0357f243b7435a732b4e62ba3157a2e upstream. On l2cap_parse_conf_req the variable efs is only initialized if remote_efs has been set. CVE: CVE-2022-42895 CC: stable@xxxxxxxxxxxxxxx Reported-by: Tamás Koczka <poprdi@xxxxxxxxxx> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx> Reviewed-by: Tedd Ho-Jeong An <tedd.an@xxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- net/bluetooth/l2cap_core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -3764,7 +3764,8 @@ done: l2cap_add_conf_opt(&ptr, L2CAP_CONF_RFC, sizeof(rfc), (unsigned long) &rfc, endptr - ptr); - if (test_bit(FLAG_EFS_ENABLE, &chan->flags)) { + if (remote_efs && + test_bit(FLAG_EFS_ENABLE, &chan->flags)) { chan->remote_id = efs.id; chan->remote_stype = efs.stype; chan->remote_msdu = le16_to_cpu(efs.msdu); Patches currently in stable-queue which might be from luiz.von.dentz@xxxxxxxxx are queue-6.0/bluetooth-l2cap-fix-accepting-connection-request-for-invalid-spsm.patch queue-6.0/bluetooth-hci_conn-fix-cis-connection-dst_type-handl.patch queue-6.0/bluetooth-l2cap-fix-attempting-to-access-uninitialized-memory.patch queue-6.0/bluetooth-l2cap-fix-memory-leak-in-vhci_write.patch queue-6.0/bluetooth-l2cap-fix-use-after-free-in-l2cap_conn_del.patch queue-6.0/bluetooth-hci_conn-fix-not-restoring-iso-buffer-coun.patch queue-6.0/bluetooth-l2cap-fix-use-after-free-caused-by-l2cap_r.patch queue-6.0/bluetooth-virtio_bt-use-skb_put-to-set-length.patch