]> git.ipfire.org Git - thirdparty/linux.git/commit
Bluetooth: l2cap: fix MPS check in l2cap_ecred_reconf_req
authorDudu Lu <phx0fer@gmail.com>
Wed, 15 Apr 2026 10:43:55 +0000 (18:43 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 6 May 2026 20:20:38 +0000 (16:20 -0400)
commit4f42363c814f28fe3f59847c35acf1ed033bedd4
tree026032f05fbae0e4b6af9dd9c70b9b008ad0ca5e
parent72b8deccff17a7644e0367e1aaf1a36cfb014324
Bluetooth: l2cap: fix MPS check in l2cap_ecred_reconf_req

The L2CAP specification states that if more than one channel is being
reconfigured, the MPS shall not be decreased. The current check has
two issues:

1) The comparison uses >= (greater-than-or-equal), which incorrectly
   rejects reconfiguration requests where the MPS stays the same.
   Since the spec says MPS "shall be greater than or equal to the
   current MPS", only a strict decrease (remote_mps > mps) should be
   rejected. Keeping the same MPS is valid.

2) The multi-channel guard 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. Replace with `&& num_scid > 1` which correctly
   checks whether the request covers more than one channel.

Fixes: 7accb1c4321a ("Bluetooth: L2CAP: Fix invalid response to L2CAP_ECRED_RECONF_REQ")
Signed-off-by: Dudu Lu <phx0fer@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/l2cap_core.c