From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 35833274FE8 for ; Sat, 21 Mar 2026 08:07:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774080468; cv=none; b=NdZcQ7uC2gF3yXMP9UCJFhCfKsoanQ9jujZSZN/zPjKdef+0at+WogmawbRz8YSIqW6Y3eLVFD2faAfC6u9PWfdUKkxV6MMW3jNB6uXkvhzoS+ttCUeTZ37ZDKs2YLtbw9oWeuEahOHVd9XknCQn+B1FRlLDtv3CE6mnXNoAX0k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774080468; c=relaxed/simple; bh=VCTeAAEPwjLmaPUOlhIxq7qiMyBJTN1/7jbpYZTPGQY=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=Zdn+guRvKl5ERmEJvyBgn0cD5s9N22LCJntdtChgRgd/ybu+B41yQZQu8Q/NlP+ljnnXKRdHUo8U7nzkJ0mhvzLd9IeboPVDqh7r+N6y82cQulTJnFkOj9yC38ByMHTglF/6h6Ub6Q1au27MTuhaTZ+dPZ6igRvXXKrJ6KM62X8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=K4bIhplW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="K4bIhplW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4359BC19421; Sat, 21 Mar 2026 08:07:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774080467; bh=VCTeAAEPwjLmaPUOlhIxq7qiMyBJTN1/7jbpYZTPGQY=; h=Subject:To:Cc:From:Date:From; b=K4bIhplWHb9lGpv/FZUXOF1ev1HLamT5+2qwvcwCT80aFe+394ww9bWyFOQ/+AYs3 VBUTHDxbmb5EJrGk7TpED8wRV2QrYMIRkYE/yhVCPecO3gCU8Ae/n5pK6D2VEnWuoF PSlKiAd/gs6PmfjuFB+5GYFaqeP1NLd+SkUL+J4w= Subject: FAILED: patch "[PATCH] Bluetooth: L2CAP: Fix accepting multiple L2CAP_ECRED_CONN_REQ" failed to apply to 5.10-stable tree To: luiz.von.dentz@intel.com,yimingqian591@gmail.com Cc: From: Date: Sat, 21 Mar 2026 09:07:13 +0100 Message-ID: <2026032113-grab-coasting-e378@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.10-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.10.y git checkout FETCH_HEAD git cherry-pick -x 5b3e2052334f2ff6d5200e952f4aa66994d09899 # git commit -s git send-email --to '' --in-reply-to '2026032113-grab-coasting-e378@gregkh' --subject-prefix 'PATCH 5.10.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 5b3e2052334f2ff6d5200e952f4aa66994d09899 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 3 Mar 2026 13:29:53 -0500 Subject: [PATCH] Bluetooth: L2CAP: Fix accepting multiple L2CAP_ECRED_CONN_REQ Currently the code attempts to accept requests regardless of the command identifier which may cause multiple requests to be marked as pending (FLAG_DEFER_SETUP) which can cause more than L2CAP_ECRED_MAX_CID(5) to be allocated in l2cap_ecred_rsp_defer causing an overflow. The spec is quite clear that the same identifier shall not be used on subsequent requests: 'Within each signaling channel a different Identifier shall be used for each successive request or indication.' https://www.bluetooth.com/wp-content/uploads/Files/Specification/HTML/Core-62/out/en/host/logical-link-control-and-adaptation-protocol-specification.html#UUID-32a25a06-4aa4-c6c7-77c5-dcfe3682355d So this attempts to check if there are any channels pending with the same identifier and rejects if any are found. Fixes: 15f02b910562 ("Bluetooth: L2CAP: Add initial code for Enhanced Credit Based Mode") Reported-by: Yiming Qian Signed-off-by: Luiz Augusto von Dentz diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 780136e18aae..9d5b8d4d375a 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -5055,7 +5055,7 @@ static inline int l2cap_ecred_conn_req(struct l2cap_conn *conn, u16 mtu, mps; __le16 psm; u8 result, rsp_len = 0; - int i, num_scid; + int i, num_scid = 0; bool defer = false; if (!enable_ecred) @@ -5068,6 +5068,14 @@ static inline int l2cap_ecred_conn_req(struct l2cap_conn *conn, goto response; } + /* Check if there are no pending channels with the same ident */ + __l2cap_chan_list_id(conn, cmd->ident, l2cap_ecred_list_defer, + &num_scid); + if (num_scid) { + result = L2CAP_CR_LE_INVALID_PARAMS; + goto response; + } + cmd_len -= sizeof(*req); num_scid = cmd_len / sizeof(u16);