From: Dudu Lu <phx0fer@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: marcel@holtmann.org, luiz.dentz@gmail.com, Dudu Lu <phx0fer@gmail.com>
Subject: [PATCH] Bluetooth: l2cap: Fix MPS check in l2cap_ecred_reconf_req
Date: Mon, 13 Apr 2026 16:56:00 +0800 [thread overview]
Message-ID: <20260413085600.75248-1-phx0fer@gmail.com> (raw)
The L2CAP Enhanced Credit Based Flow Control specification (Core Spec
5.4, Vol 3, Part A, Section 7.11) states that if more than one channel
is being reconfigured, the MPS shall not be decreased. The current code
uses `&& i` (loop index) to approximate "more than one channel", but
this incorrectly allows MPS decrease for the first channel (i==0) even
when multiple channels are being reconfigured, and incorrectly blocks
MPS decrease for subsequent channels even when only that single channel
is being reconfigured via index > 0.
Replace `&& i` with `&& num_scid > 1` which correctly checks whether
the reconfiguration request covers more than one channel, matching the
specification intent.
Signed-off-by: Dudu Lu <phx0fer@gmail.com>
---
net/bluetooth/l2cap_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 95c65fece39b..b069f965a339 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -5428,7 +5428,7 @@ static inline int l2cap_ecred_reconf_req(struct l2cap_conn *conn,
* configured, the MPS field may be less than the current MPS
* of that channel.
*/
- if (chan[i]->remote_mps >= mps && i) {
+ if (chan[i]->remote_mps >= mps && num_scid > 1) {
BT_ERR("chan %p decreased MPS %u -> %u", chan[i],
chan[i]->remote_mps, mps);
result = L2CAP_RECONF_INVALID_MPS;
--
2.39.3 (Apple Git-145)
next reply other threads:[~2026-04-13 8:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-13 8:56 Dudu Lu [this message]
2026-04-13 9:41 ` Bluetooth: l2cap: Fix MPS check in l2cap_ecred_reconf_req bluez.test.bot
2026-04-13 17:16 ` [PATCH] " Luiz Augusto von Dentz
2026-04-13 21:02 ` bluez.test.bot
-- strict thread matches above, loose matches on Subject: below --
2026-04-15 10:43 [PATCH] Bluetooth: l2cap: fix " Dudu Lu
2026-04-15 21:00 ` patchwork-bot+bluetooth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260413085600.75248-1-phx0fer@gmail.com \
--to=phx0fer@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox